@workos-inc/widgets
v1.5.1
Published
A suite of React components providing functionality for enterprise app workflows.
Maintainers
Keywords
Readme
WorkOS Widgets
A suite of React components providing functionality for enterprise app workflows.
Local Development Setup
Install dependencies
Run pnpm install in the root directory to install the dependencies.
Run an example app
The following instructions will follow using the nextjs example but the same steps can be applied to other examples.
Spin up your local WorkOS instance (
rush start).Create a
.envfile in the root of thenextjsdirectory using the.env.examplefile as a reference.Uncomment the values under
# Optional configuration.# Optional configuration WORKOS_API_HOSTNAME="localhost" WORKOS_API_HTTPS=false WORKOS_API_PORT=7000On your local WorkOS dashboard, go to the Get started homepage grab the
WORKOS_API_KEYandWORKOS_CLIENT_IDand add them to your.envfile.Generate a 32 character password for
WORKOS_COOKIE_PASSWORDand add it to your.envfile.After steps 4 and 5, your
.envfile should look like this:# https://workos.com/docs/reference/api-keys WORKOS_API_KEY="sk_dev" # retrieved from the WorkOS dashboard WORKOS_CLIENT_ID="client_dev" # retrieved from the WorkOS dashboard WORKOS_COOKIE_PASSWORD="some-password-thats-32-chars-long" # generate a 32 character password NEXT_PUBLIC_WORKOS_REDIRECT_URI="http://localhost:4040/auth/callback" # configured in the WorkOS dashboardOn your local WorkOS dashboard, go to the Redirects page and add the following URL to the Sign-in callback section:
http://localhost:4040/auth/callbackOn your local WorkOS dashboard, go to the Roles page and verify that the following exists, otherwise create it:
Permissions
Name: Manage users, Slug:
widgets:users-table:manageRoles
Name: Admin, Slug:
admin, Permissions:widgets:users-table:manageOn your local WorkOS dashboard, go to the Organizations page, add yourself as a user to an organization. Then in the Users table of the organization, open the
...menu, open the Edit role, and set the role to Admin.On your local WorkOS dashboard, go to the Authentication page and add the following URL to the Cross-Origin Resource Sharing (CORS) section:
http://localhost:4040Navigate to the
packages/hosted-authkitdirectory and runrushx startto start the hosted AuthKit service.Run
pnpm dev --filter=nextjsto start the example app.Navigate to http://localhost:4040/ and authenticate using Google to sign into your account.
