@praxa/sdk@0.3.0.
It does not target api.praxa.io/v1. You need the HTTPS origin and short-lived
OAuth issuance flow from your Praxa deployment operator.
Prerequisites
missions:write; reading or streaming it requires missions:read.
1. Create the client
2. Choose intent or mission intake
- Natural-language intent
- Canonical goal spec
Use Acceptance records intent. It does not start or prove a provider action.
submitIntent when the deployment owns deterministic compilation.3. Consume resumable events
lastEventId. Do not assume
that receiving one event proves the mission completed.
4. Signal or cancel deliberately
5. Use the client from a framework
- Next.js server action
- Express
PraxaClient construction in trusted server code.
Persist the application request ID before the first attempt; do not generate a
new value inside a retrying server action. validateMissionInput and
idempotencyKeyFor are application-owned fail-closed validation helpers.
6. Verify end to end
- Require the exact Gateway origin, contract version, and token audience for your deployment.
- Create a token with
missions:writeand a second token withmissions:readonly. - Create a mission and require a returned
runId. - Replay the exact keyed request and require the same durable mission.
- Stream at least one event, disconnect, reconnect with
Last-Event-ID, and require no duplicate sequence. - Read the mission with the read token and require the same run.
- Attempt a mutation with the read-only token and require
403. - Revoke a disposable token and require subsequent requests to fail closed.
Troubleshooting
Best practices
- Persist identity before I/O and state transitions after durable processing.
- Treat admission, delivery attempt, and cancellation request as non-terminal acknowledgements.
- Verify signatures against the raw body before parsing webhook JSON.
- Deduplicate streams and webhooks using stable event or delivery identity.
- Test disconnect, duplicate, out-of-order, timeout, revocation, and cleanup paths.
Optimize for production
- Prefer event-driven updates while retaining bounded polling or readback reconciliation.
- Commit cursors in batches only when that cannot lose acknowledged application work.
- Keep webhook handlers short: verify, persist, acknowledge, then process asynchronously.
- Measure admission-to-terminal time, reconnect rate, duplicate rate, delivery latency, and reconciliation backlog.
Cleanup and next steps
- Cancel or terminally reconcile disposable runs.
- Disable test webhook endpoints and remove their signing secrets.
- Delete synthetic inbox, cursor, and delivery records after assertions.
- Revoke disposable credentials and keep only redacted lifecycle evidence.