Skip to content

Stripe Integration

This tutorial will guide you through the process of integrating Stripe with your Raindrop application.

Prerequisites

Before you begin:

Terminal window
npm i -g @liquidmetal-ai/raindrop@latest

Configure the Manifest with Stripe Payments

Add Stripe payments to your Raindrop application, by adding the following to your Raindrop application’s manifest:

raindrop.manifest
payments {
mode = "live" // "test" or "live" is available with Stripe Payments, with test being the default mode
}
service "api" {
visibility = "paid" // visibility "paid" is a protected visibility
route "api" {
cname = "api-prod"
}
}

Deploy Your Application

Deploy your application by running the following command:

Terminal window
raindrop build deploy

Configure with Stripe Payments

Run the following command to setup Stripe payments:

Terminal window
raindrop build stripe start

This will open a browser window with the Stripe configuration process. Follow the instructions in Stripe to complete the setup.

Deploy your application with Stripe Payments

Deploy your application by running the following command:

Terminal window
raindrop build deploy

Your application is now deployed with Stripe Payments. For more information on Stripe Payments visit the Stripe Docs here.

Best Practices for Stripe Integration with Raindrop and WorkOS

WorkOS JWT Template Configuration

For payment verification to work efficiently, you must configure the WorkOS JWT template to include user metadata.

Steps:

  1. Go to your WorkOS Dashboard: https://dashboard.workos.com
  2. Navigate to AuthenticationSessionJWT Template and click Manage
  3. Replace the default template with the following:
JWT Template
{
"id": {{user.id}},
"email": {{user.email}},
"first_name": {{user.first_name}},
"last_name": {{user.last_name}},
"external_id": {{user.external_id}},
"metadata": {{user.metadata}}
}