Skip to content

WorkOS

Flareforge uses WorkOS to provide a complete user authentication system. This integration handles user sign-in, session management, and profile information.

The flareforge setup command automates storing your keys, but manual configuration within the WorkOS dashboard is required to set up your environment correctly.

You must configure your WorkOS project to allow users to sign in and be redirected back to your application.

Navigate to the API Keys section of your WorkOS dashboard.

During the flareforge setup process, you will be prompted to enter these credentials. They will be stored in your .dev.vars file with the following keys:

  • WORKOS_CLIENT_ID
  • WORKOS_API_KEY

Navigate to the Redirects section of your WorkOS dashboard.

You must add the following URIs to your settings:

  • Sign-in callback URI:
    http://localhost:5173/auth/callback
  • Logout redirect:
    http://localhost:5173/

These URLs are essential for WorkOS to securely redirect users back to your application after they sign in or out.

WorkOS provides separate “Staging” and “Production” environments. You must configure each one with the appropriate keys and redirect URIs for your local and live applications.

WorkOS environment selector showing Production and Staging options.

For local development, ensure you are in the Staging environment in your WorkOS dashboard. Use the credentials and redirect URIs listed above. The flareforge setup command is designed to work with these staging credentials and localhost URLs.

For your live application, you must use the Production environment in WorkOS.

  1. Obtain a separate Client ID and API Key from the Production environment in the WorkOS dashboard. Add these values to your production environment variables in the Cloudflare dashboard.
  2. In the Redirects settings for your WorkOS Production environment, you must replace localhost:5173 with your application’s public domain.
    • Sign-in callback URI:
      https://<YOUR_DOMAIN>/auth/callback
    • Logout redirect:
      https://<YOUR_DOMAIN>/