An example application demonstrating to use the WorkOS Node SDK to authenticate users via SSO.
Node.js version 10+
-
Clone the main repo and install dependencies for the app you'd like to use:
# HTTPS git clone https://github.com/workos/node-example-applications.gitor
# SSH git clone git@github.com:workos/node-example-applications.git -
Navigate to the Magic Link app within the cloned repo.
$ cd node-example-applications/node-magic-link-example -
Install the dependencies.
$ npm install
- Grab your API Key.
- Get your Client ID.
- Create a
.envfile at the root of the project and populate with the following environment variables (using values found above):
WORKOS_API_KEY = your_api_key_here
WORKOS_CLIENT_ID = your_project_id_here- Set your Default Redirect Link to
http://localhost:8000/success.
npm startHead to http://localhost:8000/ and enter the email address to which you want to send the Magic Link!
If you get stuck and aren't able to resolve the issue by reading our WorkOS Magic Link documentation, API reference, or tutorials, you can reach out to us at support@workos.com and we'll lend a hand.