Skip to Content
Omnibase

Quickstart

Go from zero to a working app with auth, multi-tenancy, and Stripe billing in 15 minutes

Quickstart

This guide walks you through setting up Omnibase locally, creating your first user and tenant, and configuring Stripe billing. By the end, you'll have a working backend with authentication, multi-tenancy, and payments.

Time: ~15 minutes Prerequisites: Docker, Bun (or Node.js 18+)


1. Install the CLI

npm i -g @omnibase/cli

Verify the installation:

omnibase --version

2. Initialize Your Project

Create a new directory and initialize Omnibase:

mkdir my-app && cd my-app
omnibase init

This creates an omnibase/ directory with:

my-app/
└── omnibase/
    ├── omnibase.toml        # Project config: deployments, auth, versions
    ├── .env.local           # Local env vars & secrets (gitignored)
    ├── db/                  # Database migrations + RLS policies
    ├── email/               # HTML email templates
    ├── permissions/         # RBAC permission namespaces
    └── stripe/              # Stripe product/price config (*.config.json)

The scaffolder also drops in a sample omnibase/workers/ Cloudflare Worker so omnibase start has something to run out of the box. For real projects you'll usually delete it and point [[deployments]] at your own wrangler apps instead.

The heart of your project is omnibase/omnibase.toml. It declares which apps to deploy, the auth settings, and which service versions to use:

project_id = "..." # set when you create a cloud project

[[deployments]]
name = "api"
path = "../apps/api"        # any dir with a wrangler.toml + `bun run dev`
port = 8787                 # optional; defaults to 8787 + deployment index

[auth]
website_url = "http://127.0.0.1:3000"
allowed_return_urls = ["http://127.0.0.1:3000", "http://localhost:3000"]

3. Configure Environment

Local secrets and environment variables live in omnibase/.env.local:

# Required
OMNIBASE_API_URL=http://localhost:8080
OMNIBASE_SERVICE_KEY=VERY_SECRET_KEY

# Auth Configuration
WEBSITE_URL=http://127.0.0.1:3000
COOKIE_SECRET=change-this-to-a-secure-random-string
CIPHER_SECRET=32-character-secret-for-encryption

# Stripe (get keys from https://dashboard.stripe.com/apikeys)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...

For other environments (a branch, staging, prod) create a matching file — omnibase/.env.<environment> or omnibase/.env.<branch_name> — and select it with omnibase --env <name>. These files are gitignored. Values resolve in order: process.env → omnibase/.env.<env>.


4. Start Services

Launch everything with a single command:

omnibase start

omnibase start runs in the foreground and streams logs; press Ctrl+C to stop everything, or use omnibase start -d to run the containers in the background (stop them with omnibase stop). It does two things:

  1. Starts the control plane with Docker Compose — Postgres + PgBouncer, the REST API, Auth (Kratos), Permissions (Keto), PostgREST, Mailpit (email), RustFS (S3-compatible storage), and Adminer, then runs database migrations.
  2. Spawns a dev server (bun run dev) for every deployment in omnibase.toml, on ports starting at 8787.
ServiceURL
REST APIhttp://localhost:8080
Auth (Kratos)http://127.0.0.1:4433
PostgRESThttp://localhost:8001
Adminer (DB UI)http://localhost:8081
RustFS console (storage)http://localhost:9001
Mailpit (email UI)http://localhost:8025
Your deploymentshttp://localhost:8787+

Wait for the health check to pass:

curl http://localhost:8080/health/ready
# {"status":"ready","ready":true,"services":{"database":"ok","auth":"ok","permissions":"ok","postgrest":"ok","storage":"ok"}}

5. Sync Configuration

Push your local configurations to the running services:

omnibase sync all

This syncs:

  • Permissions — RBAC namespaces to Keto
  • Database — SQL migration files
  • Email — HTML email templates
  • Stripe — product/price configuration

(The env service is cloud-only and is skipped locally.)


6. Create Your First User and Tenant

Omnibase ships typed SDKs generated from the OpenAPI spec in several languages, so you can use whichever fits your stack:

  • JavaScript / TypeScript — @omnibase/core-js
  • Go — github.com/phoenixsolutionsgroup/omnibase/sdk/core/go
  • Framework SDKs — @omnibase/nextjs, @omnibase/react, and shadcn/ui components

Every SDK exposes the same API surface. For this demo we'll use the JavaScript SDK:

npm install @omnibase/core-js
# or
bun add @omnibase/core-js

Create a user and tenant programmatically:

import { Configuration, V1AuthApi, V1TenantsLifecycleApi } from '@omnibase/core-js';

const config = new Configuration({
  basePath: 'http://localhost:8080',
  apiKey: (name) => (name === 'X-Service-Key' ? 'VERY_SECRET_KEY' : ''), // Server-side operations
});

// Create a user
const authApi = new V1AuthApi(config);
const user = await authApi.createUser({
  createUserRequest: {
    email: 'admin@example.com',
    password: 'secure-password-123',
    name: { first: 'Admin', last: 'User' },
  },
});

console.log('User created:', user.id);

// Create a tenant (organization). The creator becomes the tenant owner.
const tenantsApi = new V1TenantsLifecycleApi(config);
const { tenant, token } = await tenantsApi.createTenant({
  createTenantRequest: {
    name: 'Acme Corporation',
    billingEmail: 'billing@acme.com',
  },
});

console.log('Tenant created:', tenant.id);
console.log('Stripe Customer:', tenant.stripeCustomerId);
console.log('Tenant JWT:', token);

When a tenant is created, Omnibase automatically creates a Stripe customer and returns a tenant-scoped JWT (token) you can use for subsequent requests.


7. Configure Stripe Products

Create a billing configuration as a *.config.json file in omnibase/stripe/ (any name works, e.g. products.config.json). The $schema points at the running API so your editor gives you typed validation and autocomplete:

{
  "$schema": "http://localhost:8080/api/v1/stripe/schema",
  "version": "1.0.0",
  "products": [
    {
      "id": "free_plan",
      "name": "Free",
      "description": "Get started for free",
      "type": "service",
      "prices": [
        {
          "id": "free_monthly",
          "amount": 0,
          "currency": "usd",
          "interval": "month"
        }
      ]
    },
    {
      "id": "pro_plan",
      "name": "Professional",
      "description": "For growing teams",
      "type": "service",
      "prices": [
        {
          "id": "pro_monthly",
          "amount": 2900,
          "currency": "usd",
          "interval": "month"
        },
        {
          "id": "pro_yearly",
          "amount": 29000,
          "currency": "usd",
          "interval": "year"
        }
      ]
    }
  ]
}

The schema is served by the API at /api/v1/stripe/schema, so start services (omnibase start) before your editor tries to fetch it. If you don't want editor validation, drop the $schema line.

Push to Stripe:

omnibase stripe push

You'll see output like:

✔ Successfully loaded config
✔ Configuration uploaded successfully!

Products created: 2
   - Free (free_plan)
   - Professional (pro_plan)
Prices created: 3
   - free_monthly (product: free_plan)
   - pro_monthly (product: pro_plan)
   - pro_yearly (product: pro_plan)

8. Create a Checkout Session

Now create a checkout session for your tenant:

import { V1PaymentsApi } from '@omnibase/core-js';

const paymentsApi = new V1PaymentsApi(config);

const { url } = await paymentsApi.createCheckout({
  createCheckoutRequest: {
    priceId: 'pro_monthly',
    successUrl: 'http://localhost:3000/success',
    cancelUrl: 'http://localhost:3000/pricing',
  },
});

console.log('Checkout URL:', url);
// Redirect user to url

Next Steps

You now have a working Omnibase setup with:

  • User authentication via Ory Kratos
  • Multi-tenant organization support
  • Stripe billing integration

Continue learning:


Stopping Services

When you're done developing:

omnibase stop

This gracefully shuts down the control plane containers and terminates any spawned deployment dev servers, while preserving your data.


Troubleshooting

Services won't start

Check Docker is running:

docker info

Health check fails

List running containers and inspect the API logs (containers are prefixed with omnibase-<your-project-dir>):

docker ps
docker logs omnibase-my-app-rest-api-1

Or restart a single service with the CLI:

omnibase restart api

Stripe push fails

Verify your Stripe keys in omnibase/.env.local and ensure you're using test mode keys (sk_test_...).

On this page