X Tutup
Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Node.js Example App with Magic Link powered by WorkOS

An example application demonstrating to use the WorkOS Node SDK to authenticate users via SSO.

Prerequisites

Node.js version 10+

Node Project Setup

  1. 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.git

    or

    # SSH
    git clone git@github.com:workos/node-example-applications.git
  2. Navigate to the Magic Link app within the cloned repo.

    $ cd node-example-applications/node-magic-link-example
  3. Install the dependencies.

    $ npm install

Configure your environment

  1. Grab your API Key.
  2. Get your Client ID.
  3. Create a .env file 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
  1. Set your Default Redirect Link to http://localhost:8000/success.

Run the server

npm start

Head to http://localhost:8000/ and enter the email address to which you want to send the Magic Link!

Need help?

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.

X Tutup