Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
widget readme addition (#28) RELEASE
Browse files Browse the repository at this point in the history
* widget readme addition

* pr fix
  • Loading branch information
ruvenzx authored Mar 25, 2024
1 parent de35c17 commit f5e4fe2
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,98 @@ export async function GET(req) {
This section is Working in progress :-)
In the meantime, you can see the example in the [Pages Router](/examples/pages-router/) folder.

### Widgets

Widgets are components that allow you to expose management features for tenant-based implementation. In certain scenarios, your customers may require the capability to perform managerial actions independently, alleviating the necessity to contact you. Widgets serve as a feature enabling you to delegate these capabilities to your customers in a modular manner.

Important Note:

- For the user to be able to use the widget, they need to be assigned the `Tenant Admin` Role.

#### User Management

The `UserManagement` widget will let you embed a user table in your site to view and take action.

The widget lets you:

- Create a new user
- Edit an existing user
- Activate / disable an existing user
- Reset an existing user's password
- Remove an existing user's passkey
- Delete an existing user

Note:

- Custom fields also appear in the table.

###### Usage

```js
import { UserManagement } from '@descope/nextjs-sdk';
...
<UserManagement
widgetId="user-management-widget"
tenant="tenant-id"
/>
```

Example:
[Manage Users](./examples/app-router/app/manage-users/page.tsx)

#### Role Management

The `RoleManagement` widget will let you embed a role table in your site to view and take action.

The widget lets you:

- Create a new role
- Change an existing role's fields
- Delete an existing role

Note:

- The `Editable` field is determined by the user's access to the role - meaning that project-level roles are not editable by tenant level users.
- You need to pre-define the permissions that the user can use, which are not editable in the widget.

###### Usage

```js
import { RoleManagement } from '@descope/nextjs-sdk';
...
<RoleManagement
widgetId="role-management-widget"
tenant="tenant-id"
/>
```

Example:
[Manage Roles](./examples/app-router/app/manage-roles/page.tsx)

#### Access Key Management

The `AccessKeyManagement` widget will let you embed an access key table in your site to view and take action.

The widget lets you:

- Create a new access key
- Activate / deactivate an existing access key
- Delete an exising access key

###### Usage

```js
import { AccessKeyManagement } from '@descope/nextjs-sdk';
...
<AccessKeyManagement
widgetId="access-key-management-widget"
tenant="tenant-id"
/>
```

Example:
[Manage Access Keys](./examples/app-router/app/manage-access-keys/page.tsx)

## Code Example

You can find an example react app in the [examples folder](./examples). - [App Router](/examples/app-router/) - [Pages Router](/examples/pages-router/)
Expand Down

0 comments on commit f5e4fe2

Please sign in to comment.