Skip to main content
The starter app is a small Next.js feed. Its request code is plain TypeScript, so you can move it into any backend.

1. Run the starter app with sample data

You need Node.js 24 and npm. You do not need an account.
Terminal
Open http://localhost:3000. The feed shows fictional posts under a Sample data label. Search for an asset to filter the feed, or select Refresh to read it again.

2. Switch to live data

  1. Create an API key in API key settings. See Get access for the account you need.
  2. Copy .env.example to .env.local.
  3. In .env.local, set the mode and your key:
    .env.local
  4. Restart npm run dev.
The label changes to Live API mode and recent activity loads. If the key is missing or lacks a scope, the page shows an error. It never falls back to sample data. A CENTAUR_API_KEY or CENTAUR_DATA_MODE exported in your shell overrides .env.local.
Keep the API key on your server. Never put it in a NEXT_PUBLIC_ variable or browser code. Anyone who can reach a public deployment of this app spends the key’s quota.

3. Make it yours

lib/centaur.ts has no Next.js or React imports, so you can copy it into another TypeScript backend.

Call the API directly

Set the key in your terminal first:
Terminal
The examples repository also has TypeScript recipes for the same tasks. They run on Node.js 24 with no installation.

Read and filter the feed

Terminal
Omit assetIds for the general feed. Look up asset and trader IDs once during setup with Find IDs, not before every read. Page back with meta.nextCursor (Pagination). For new activity, poll the feed or receive webhooks.

Handle errors

  • Read the status and the error code: Errors and limits says what each one means and when to retry. Add --include to curl to see the status and headers.
  • In the TypeScript recipes, catch CentaurApiError to read status, code, requestId, and retryAfter. The client does not retry on its own.
  • Keep upstream error details on your server and show visitors a safe message.
Last modified on October 26, 2026