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.
Configuration Steps
Section titled “Configuration Steps”You must configure your WorkOS project to allow users to sign in and be redirected back to your application.
1. Obtain Credentials
Section titled “1. Obtain Credentials”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
2. Configure Redirects
Section titled “2. Configure Redirects”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.
Environments
Section titled “Environments”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.
Development
Section titled “Development”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.
Production
Section titled “Production”For your live application, you must use the Production environment in WorkOS.
- 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.
- 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>/
- Sign-in callback URI: