Overview
The Widgets API allows you to embed WorkOS UI components directly into your application. By generating secure, scoped tokens, you can provide self-service capabilities to your users without redirecting them to external pages.Methods
getToken
Generates a secure token for rendering WorkOS widgets in your application.Token generation options
A secure JWT token to be used with WorkOS widget components
Example - Users Table Widget
Example - SSO Configuration Widget
Example - Multiple Scopes
Widget Scopes
widgets:users-table:manage
widgets:users-table:manage
Provides access to a user management table widget that allows viewing, inviting, and managing users within an organization.
widgets:sso:manage
widgets:sso:manage
Enables an embedded SSO configuration widget for setting up and managing Single Sign-On connections.
widgets:domain-verification:manage
widgets:domain-verification:manage
Allows domain verification management through an embedded widget interface.
widgets:dsync:manage
widgets:dsync:manage
Provides an embedded Directory Sync configuration and management interface.
widgets:api-keys:manage
widgets:api-keys:manage
Enables API key management capabilities within your application interface.
Frontend Integration
Once you generate a token on your backend, pass it to your frontend to initialize WorkOS widgets:Security Considerations
The
userId parameter is optional but recommended for widgets that need to associate actions with specific users, such as the users table widget.Benefits of Widgets
Embedded Experience
Keep users in your application without redirects to external portals
Customizable
Widgets inherit your application’s styling and branding
Secure
Scoped tokens ensure users only access permitted resources
Maintained by WorkOS
Automatically updated with new features and security improvements
Related Resources
Portal
Generate links to the full Admin Portal experience
Organizations
Manage organizations programmatically