onari

Build with an AI agent

Point Cursor, Claude Code, Copilot or ChatGPT at these docs.

View as Markdown

These docs are written so coding agents can follow them.

  • https://docs.onari.xyz/llms.txt: an index of every page, for agents that support it.
  • https://docs.onari.xyz/llms-full.txt: the whole site as one Markdown file.
  • Any page as Markdown: add .md to its URL, for example /docs/webhooks.md. Every page also has Copy as Markdown.

A prompt that works

Integrate Onari (https://docs.onari.xyz/llms-full.txt) into this codebase.

1. Find where these actions are confirmed on the server: <list your actions, e.g. order paid, transfer settled>.
   After each one, POST it to https://api.onari.xyz/v1/events with the user's internal ID as player_id,
   the amount in minor units, and our transaction ID as idempotency_key. Don't block the user's request on it;
   log and retry on failure. Never send names, phone numbers or emails.
2. Add POST /onari/webhooks that verifies Standard Webhooks signatures with ONARI_WEBHOOK_SECRET using the
   raw body, and for reward.issued (not vouchers) pays the player exactly once using idempotency_key with a
   unique constraint. Reply 200 fast.
3. Add a server endpoint that calls POST /v1/hub/sessions for the signed-in user and returns the url,
   and open it in a WebView from our Rewards screen.
Use ONARI_SECRET_KEY from the environment. Write tests for the webhook handler.

On this page