SureStack Docs

Everything you need to go from license key to running project.

Quick start

Four steps from install to your first deployed project.

1

Install the CLI

Requires Node.js 18 or later.

$ npm install -g surestack
2

Activate your license

You'll be prompted on first run, or pass it directly.

$ surestack init myproject --key SK-XXXX-XXXX-XXXX-XXXX
3

Provision your stack

SureStack connects Vercel, Supabase, Clerk, Stripe, and Resend automatically. Follow the prompts for any API keys it needs.

$ surestack init myproject # Provisions 6 services, wires env vars, generates STACK.md
4

Start building

Open the project with Claude Code. STACK.md is auto-loaded as context so Claude knows your entire stack.

$ cd myproject && claude .

Command 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.

FlagDescription
--key <key>License key. Skips the interactive prompt if provided.
--template <name>Stack template to use. Default: ai-saas
--freshIgnore 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-runValidate config and credentials without actually provisioning.
--output <dir>Custom output directory instead of ./{project-name}
$ surestack init myapp --template ai-saas --skip resend --dry-run

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.

$ surestack status myapp # Vercel ✓ connected project: myapp # Supabase ✓ connected tables: 3 # Clerk ✓ connected users: 12 # Stripe ✓ connected webhook: active # Resend ✓ connected domain: verified

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.

$ surestack env myapp # Rewrites .env.local, STACK.md, .claudecode/config.json

What gets provisioned

Each surestack init run connects and configures these six services in order.

ServiceRoleWhat 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 Email 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.

Environment 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.

VariableSourceUsage
NEXT_PUBLIC_APP_URLVercelYour deploy URL. Used for absolute links, OG images, callbacks.
NEXT_PUBLIC_SUPABASE_URLSupabasePublic Supabase endpoint for client-side queries.
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabaseAnon key for RLS-protected client access.
SUPABASE_SERVICE_ROLE_KEYSupabaseServer-only. Bypasses RLS for admin operations.
DATABASE_URLSupabaseDirect Postgres connection string for migrations and ORMs.
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerkPublic key for Clerk's frontend SDK.
CLERK_SECRET_KEYClerkServer-only. Validates sessions and manages users.
STRIPE_PUBLISHABLE_KEYStripePublic key for Stripe.js and Elements.
STRIPE_SECRET_KEYStripeServer-only. Creates charges, manages subscriptions.
STRIPE_WEBHOOK_SECRETStripeServer-only. Verifies webhook signatures.
RESEND_API_KEYResendServer-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:

$ surestack env myproject

Troubleshooting

License key not found

The key you entered doesn't match any record in our system.

Double-check for typos. Keys are in the format 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.

Purchase a new license at surestack.dev or contact support if this is an error.

Provisioning halted — VERCEL_TOKEN missing

SureStack needs a Vercel personal access token to create and configure your project.

Generate a token at 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.

Verify your Supabase project is active (not paused) at 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.

Make sure your app is deployed to Vercel first. Run 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.

Go to 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.

Run 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.

Check your internet connection. If you're behind a corporate proxy, ensure surestack.dev is allowed. Retry with surestack init myproject --key YOUR_KEY.

Support

Need help?

We typically respond within a few hours on business days.

support@surestack.dev