Stripe Integration
Revana Stripe webhook integration for a NestJS route
We assume at this point that your route file has the following configured already:
- a JavaScript runtime that gives you access to the raw request body
- a configured
stripeinstance - a valid
STRIPE_WEBHOOK_SECRET
Install the package
Before wiring the webhook route into your application, install the Revana JavaScript package using the package manager your project already uses.
npm install @revana/jspnpm add @revana/jsyarn add @revana/jsbun add @revana/jsRevana Setup
In your environment variables create a new variable called REVANA_API_KEY and make sure you pass the correct space api key which you would like the daa to feed into, this is explained over in the revana dashboard under the user dropdown the api managment
simply add the following code to your project where you have your stripe webhook endpoint
import { Revana } from "@revana/js";
const revana = new Revana({
apiKey: process.env.REVANA_API_KEY,
});