Skip to main content
Start a new app with a working Bachs integration. Choose a template for your framework and the payment flow your product needs, then follow its setup instructions and test it in the sandbox.

Available templates

Next.js SaaS

Use this starter for a product that charges for ongoing access, such as a software tool or a membership app. The starter uses the official Bachs SDK for checkout, product setup, customer portal sessions, and webhook verification. It saves subscription state and grants access after a verified webhook. A success redirect cannot grant access. You need Node.js 22 or later, a sandbox API key, and the Bachs CLI. See the repository’s README for setup and SDK package instructions.
This is a local development starter. Every visitor shares a demo user, and billing data is stored in a local JSON file. Replace authentication and storage before deploying. Add your product’s features and choose its access policy.

Start building

  1. Open the template repository and select Use this template to create your own copy.
  2. Follow its README to configure sandbox products, start the webhook listener, and run the app. Authenticate the CLI to the same sandbox account as the app.
  3. Complete a sandbox checkout. Confirm that the webhook saves the subscription, access activates, and Manage billing opens the correct customer’s portal.
  4. Adapt the app to your product. Replace the demo components, run the included tests, and follow the go-live checklist.
For a fully local app, the starter leaves checkout return URLs unset. Return to the app manually after payment. Automatic return requires a public URL; webhook forwarding through the CLI still works locally.

Learn the flow

  • SaaS subscriptions: understand the objects, requests, webhook events, and access decisions used in this template.
  • Skills and prompts: use a coding assistant to adapt subscription billing to your app.
  • Live demo: try other billing models in the sandbox.