SureStack Docs
Everything you need to go from license key to running project.
Getting startedQuick start
Four steps from install to your first deployed project.
Install the CLI
Requires Node.js 18 or later.
Activate your license
You'll be prompted on first run, or pass it directly.
Provision your stack
SureStack connects Vercel, Supabase, Clerk, Stripe, and Resend automatically. Follow the prompts for any API keys it needs.
Start building
Open the project with Claude Code. STACK.md is auto-loaded as context so Claude knows your entire stack.
CLICommand reference
surestack init <project-name>
Provision a complete AI SaaS backend stack. Creates a project directory, connects all services, generates .env.local and STACK.md, and configures Claude Code.
| Flag | Description |
|---|---|
| --key <key> | License key. Skips the interactive prompt if provided. |
| --template <name> | Stack template to use. Default: ai-saas |
| --fresh | Ignore existing state and re-provision from scratch. |
| --framework <name> | Target framework. Default: nextjs |
| --skip <services> | Comma-separated list of services to skip. E.g. --skip resend,clerk |
| --dry-run | Validate config and credentials without actually provisioning. |
| --output <dir> | Custom output directory instead of ./{project-name} |
Provisioning is resumable. If a step fails, fix the issue and re-run the same command. Completed steps are skipped automatically.
surestack status [project-name]
Show the provisioning status and health of each connected service. Checks API key validity, webhook registration, and connection health.
If no project name is given, it auto-detects from the .surestack/ directory in the current folder.
surestack env [project-name]
Regenerate .env.local, STACK.md, and Claude Code config from the saved provisioning state. Useful if you accidentally deleted a file or need to re-sync after manual changes.
InfrastructureWhat gets provisioned
Each surestack init run connects and configures these six services in order.
| Service | Role | What SureStack does |
|---|---|---|
| Vercel | Hosting | Creates or links the project, sets up deploy URL, injects all env vars. |
| Supabase | Database + Auth | Provisions a Postgres project, generates anon + service role keys, sets up RLS. |
| Clerk | Authentication | Creates application, configures JWT template for Supabase integration. |
| Stripe | Payments | Registers webhook endpoint at /api/webhooks/stripe, provisions API keys. |
| Resend | Creates API key, configures sending domain for transactional email. | |
| Compose | Orchestration | Injects env vars into Vercel, writes .env.local, generates STACK.md, wires Claude Code config. |
ConfigurationEnvironment variables
After provisioning, all secrets and config live in .env.local at your project root. They're also injected into your Vercel project for production deploys.
| Variable | Source | Usage |
|---|---|---|
| NEXT_PUBLIC_APP_URL | Vercel | Your deploy URL. Used for absolute links, OG images, callbacks. |
| NEXT_PUBLIC_SUPABASE_URL | Supabase | Public Supabase endpoint for client-side queries. |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase | Anon key for RLS-protected client access. |
| SUPABASE_SERVICE_ROLE_KEY | Supabase | Server-only. Bypasses RLS for admin operations. |
| DATABASE_URL | Supabase | Direct Postgres connection string for migrations and ORMs. |
| NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk | Public key for Clerk's frontend SDK. |
| CLERK_SECRET_KEY | Clerk | Server-only. Validates sessions and manages users. |
| STRIPE_PUBLISHABLE_KEY | Stripe | Public key for Stripe.js and Elements. |
| STRIPE_SECRET_KEY | Stripe | Server-only. Creates charges, manages subscriptions. |
| STRIPE_WEBHOOK_SECRET | Stripe | Server-only. Verifies webhook signatures. |
| RESEND_API_KEY | Resend | Server-only. Sends transactional email. |
Variables prefixed with NEXT_PUBLIC_ are safe to expose to the browser. All others must only be used in server-side code (API routes, Server Components, Server Actions).
To regenerate .env.local from your saved state without re-provisioning:
HelpTroubleshooting
License key not found
The key you entered doesn't match any record in our system.
SK-XXXX-XXXX-XXXX-XXXX. Check the email from your purchase for the original key.License revoked
Your license was deactivated, usually due to a refund.
Provisioning halted — VERCEL_TOKEN missing
SureStack needs a Vercel personal access token to create and configure your project.
vercel.com/account/tokens and set it as VERCEL_TOKEN in your shell environment, then re-run surestack init.Supabase connection refused
The CLI couldn't reach the Supabase API with the provided credentials.
app.supabase.com. Check that your access token hasn't expired.Stripe webhook not receiving events
The webhook endpoint at /api/webhooks/stripe returns 404 or doesn't respond.
surestack status to verify the webhook is registered. Check the Stripe dashboard under Developers → Webhooks for delivery logs.Resend domain not verified
Emails are failing because the sending domain hasn't been verified.
resend.com/domains and add the DNS records shown. Verification can take up to 72 hours. SureStack will send from a test domain in the meantime.STACK.md not loading in Claude Code
Claude doesn't seem aware of your stack configuration.
surestack env to re-register STACK.md in .claudecode/config.json. Then restart Claude Code.Could not reach license server
Network error when validating your key.
surestack.dev is allowed. Retry with surestack init myproject --key YOUR_KEY.