Prebit Developer Docs

Example Apps

Copy one, don't read it — five runnable examples.

Developers copy examples; they rarely read long docs. All five live in prebit-examples as single-file, runnable scripts (Node/Bun + native fetch) — not scaffolded apps, so there's nothing to install per example beyond the repo root's npm install.

ExampleDemonstrates
hello-worldThe smallest possible integration: one API call, given an access token you already have.
oauth-exampleThe full authorize → local callback server → token-exchange flow, end to end — OAuth is usually the hardest part to get right from docs alone.
product-syncCreating products from a local feed via @prebit/sdk, with real idempotency-key reuse on retry.
inventory-syncSetting absolute stock levels from a mock feed, with the concurrent-write caveat noted inline.
webhook-listenerVerifying and logging inbound webhook deliveries — the exact header names and HMAC check, nothing else in the way.

Running one

git clone <prebit-examples>
cd prebit-examples
npm install
cp oauth-example/.env.example oauth-example/.env   # fill in your PartnerApp's client id/secret
npm run oauth-example

Each example's own README.md documents what env vars it needs.

The official starter app

If you're starting a real app (not just exploring one flow), clone prebit-app-template-next instead — it's the same OAuth callback and webhook receiver as the examples above, wired into a real Next.js app with .env.local, a real prebit.app.toml, and SDK/CLI/runtime version compatibility declarations.

npx create-prebit-app my-app

On this page