WorkOS Integration
This tutorial will guide you through the process of integrating WorkOS with your Raindrop application. To use WorkOS as an authentication provider for your Raindrop application, we will be creating a WorkOS Team and a WorkOS Environment for your Raindrop organization and application, then configuring your authentication redirects and CORS for sessions.
Prerequisites
Before you begin:
- LiquidMetal Account: Sign up at liquidmetal.run
- A Raindrop Application: Either a backend application with a domain name or a frontend application
- Raindrop CLI: Install the latest version of the Raindrop CLI:
npm i -g @liquidmetal-ai/raindrop@latestEstablish your Raindrop Organization with a WorkOS Team
To establish your Raindrop Organization with a WorkOS team, run the following command:
raindrop build workos setupThis will prompt you to create a new WorkOS team in your Raindrop Organization.
Expected Output:
✅ WorkOS integration activated successfully!
Team Details: Team ID: team_123 Team Name: My Team Created: 2021-01-01 12:00:00
Next steps: • Check your email for the team admin invitation • Create environments for your apps: raindrop build workos env create <app-name> • Invite team members: raindrop build workos invite <email> --role <role>Deploy Your Application
Deploy your application by running the following command:
raindrop build deployCreate and Attach a WorkOS Environment to Your Raindrop Application
Create a new WorkOS environment by running the following command:
raindrop build workos env create <app-name>This will automatically attach the WorkOS environment to your application.
Expected Output:
✅ WorkOS environment created successfully!
Environment Details: Environment ID: env_123 Environment Name: My Environment Created: 2021-01-01 12:00:00Expected Output:
✅ WorkOS environment created for test-app
Environment: <app-name> Type: staging Attached to: <app-name> (current version)
The environment, organization, and API key have been automatically configured.Environment has been attached to the current version.
Next Steps - Required Configuration:
1. Configure Auth Redirects: https://dashboard.workos.com/<environment-id>/redirects Add your application redirect URIs for authentication flows
2. Configure CORS for Sessions: https://dashboard.workos.com/<environment-id>/authentication/sessions Add allowed origins for frontend applications
3. Implement CORS Hook: Ensure your Raindrop application has a CORS hook configured This is required for frontend clients to communicate with your API
View details with: raindrop build workos env get test-appConfigure Auth Redirects
- Configure your application’s redirect URIs for authentication flows by visiting WorkOS’ dashboard by using the URL output. You can also click here: https://dashboard.workos.com.
- Click
Redirectsunder theDevelopersection in the left sidebar. - Click
Add Redirect URIunderRedirect URIs. - Add your application’s redirect URIs for authentication flows.
Configure CORS
- Configure your application’s CORS by visiting WorkOS’ dashboard by using the URL output. You can also click here: https://dashboard.workos.com.
- Click
Authenticationunder theConfigurationssection in the left sidebar. - Click
Sessions. - Under
Cross-Origin-Resource-Sharing (CORS), clickManage. - Add your application’s allowed origins for frontend applications.
Your application’s Authentication and CORS is now configured.
Deploy your Authentication and CORS configured application
Deploy your application by running the following command:
raindrop build deployYour application is now deployed with WorkOS Authentication. For more information on how to use WorkOS, visit their WorkOS Connect Docs.
Now that you configured your application with WorkOS, you can proceed with the Stripe Integration tutorial to add Stripe payments to your Raindrop application.