Skip to main content

Install the middleware

Add the Express adapter and Zod:
Terminal

Create the checkout entry route

Mount Checkout on a GET route. The middleware resolves the checkout and sends the buyer to it.

Inputs accepted by the checkout route

For example, ?products=123&customerExternalId=user_42 selects a product and ties the session to your application identity.

Create the account-management route

Return the Ruba customer ID for the current application user. The middleware then opens that customer’s portal.

Receive signed events

Mount Webhooks after JSON parsing. It validates the Ruba signature before invoking your callback.

Choose callback granularity

Use onPayload as a catch-all or register callbacks around the domain your application owns: