Skip to main content

Add the route adapter

Install the adapter and its schema dependency:
Terminal

Route buyers into checkout

Export Checkout as an App Router GET handler. It creates the session and manages the browser transition.
checkout/route.ts

Inputs accepted by the checkout route

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

Give customers a portal route

Resolve the signed-in user to a Ruba customer ID, then let the handler create the portal transition.
portal/route.ts

Verify webhook delivery

Expose Webhooks as POST. The adapter verifies the incoming signature before handing your code a typed payload.
api/webhook/ruba/route.ts

Choose callback granularity

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