If your SaaS product is built with Node.js and you want to incorporate WorkOS’ Admin Portal functionality, you can do a dry-run of the Admin Portal integration on our example Node.js app which makes use of the WorkOS Node.js SDK.
1. In your CLI, navigate to the directory into which you want to clone this git repo:
2. Clone this repo and install dependencies:
3. Navigate to the Node.js Admin Portal example app, located within the cloned repo:
4. Install the dependencies:
6. Create a .env file in the example app’s project directory, node-directory-sync-example/. (This file is listed in this repo's .gitignore file, so your sensitive information will not be checked into version control.).
7. Open the .env file with your preferred text editor and add the WORKOS_API_KEY and WORKOS_CLIENT_ID:
8. To ensure the example app is served as expected, start the server:
9. Update the Admin Portal Redirect Link at the bottom of the "Configuration" page of your WorkOS Dashboard. The URL to use is http://localhost:8000.
After an Admin Portal user creates an SSO connection using the Admin Portal, they need to be redirected to a webpage within your application (usually this webpage confirms successful creation of the connection). To configure which webpage this is, enter the webpage’s URL in the Configuration section of your WorkOS dashboard under the “Admin Portal Redirect Link” header. For production usage this URL must begin with HTTPS, but for development purposes the URL can begin with HTTP.
10. With the Node server running, navigate to http://localhost:8000/ to view the example Admin Portal!
11. Enter the name of the new Organization to be created and the names of all of the Organization's associated domains.
If you get stuck and aren't able to resolve the issue by reading our WorkOS Admin Portal documentation, API reference, or tutorials, you can reach out to us at [email protected] and we'll lend a hand.