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.
| Example | Demonstrates |
|---|---|
hello-world | The smallest possible integration: one API call, given an access token you already have. |
oauth-example | The full authorize → local callback server → token-exchange flow, end to end — OAuth is usually the hardest part to get right from docs alone. |
product-sync | Creating products from a local feed via @prebit/sdk, with real idempotency-key reuse on retry. |
inventory-sync | Setting absolute stock levels from a mock feed, with the concurrent-write caveat noted inline. |
webhook-listener | Verifying 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-exampleEach 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