Widgets are React components that provide complete functionality for common enterprise app workflows.
Generate a widget token scoped to an organization and user with the specified scopes.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const { token } = await workos.widgets.getToken({ organizationId: 'org_01EHZNVPK3SFK441A1RGBFSHRT', userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', scopes: ['widgets:users-table:manage'], });
POST
/widgets/token
organization_id: string
user_id?: string
scopes?: ("widgets:users-table:manage" | "widgets:domain-verification:manage" | "widgets:sso:manage" | ...)[]"widgets:users-table:manage" | "widgets:domain-verification:manage" | "widgets:sso:manage" | "widgets:api-keys:manage" | "widgets:dsync:manage" | "widgets:audit-log-streaming:manage"
Returns
token: string