Quick start

Run your first Molar Clone locally — Go tests, TypeScript SDK, CLI, and Playwright.

Quick start

Get a Stripe clone running in under five minutes.

Prerequisites: Go 1.22+ (binaries), Node.js 20+ (SDK), or a hosted fleet at app.molar.it/dashboard/clones.


npm install @molar/clones
import { stripe } from "@molar/clones";

const clone = await stripe.start({
  seed: "checkout-v1", // drives deterministic IDs; use seedData() for customers
  runId: "run-demo-001",
});

const customer = await clone.request("/v1/customers", {
  method: "POST",
  body: new URLSearchParams({ email: "jane@example.com" }),
});

await clone.advanceClock("30d");
const checkpoint = await clone.snapshot();
await clone.stop();

Go binary

MOLAR_CLONE_ADDR=127.0.0.1:8000 \
MOLAR_CLONE_ADMIN_ADDR=127.0.0.1:9000 \
MOLAR_CLONE_SEED=demo \
go run ./cmd/clones-stripe

Kinds: clones-stripe, clones-twilio, clones-email, clones-auth, clones-s3, clones-control.

Multi-clone convention: API ports 8001–8006, admin = API + 1000.


CLI

go run ./cmd/molar clones spawn stripe --seed demo
npm exec molar -- clones list

Playwright fixture

import { test } from "@molar/clones/playwright";

test("checkout", async ({ stripeClone }) => {
  process.env.STRIPE_SECRET_KEY = stripeClone.testKey;
  process.env.STRIPE_API_BASE = stripeClone.url;
});

Hosted cloud

  1. Sign in at app.molar.it.
  2. Open Dashboard → Clones.
  3. Spawn new session → copy the env block.
export MOLAR_CLONE_STRIPE_URL="https://clone-abc.clones.molar.it"
export MOLAR_CLONE_STRIPE_ADMIN_URL="https://admin-abc.clones.molar.it"

Verify

go test ./...
npm test --workspaces --if-present

Wire your application

VariableValue
STRIPE_SECRET_KEYclone.testKey
STRIPE_API_BASEclone.url + /t/{runId}
AWS_ENDPOINT_URLS3 clone endpoint

Responses include X-Molar-Clone: {kind}@<version> for SDK verification.


Next steps