Public Runtime API v1 Live (1.0.0-dev-pilot)
Custom Transactions V2: Planned (Not Deployed)
@trustlith/sdk-js: Local Prototype Only
AI-Assisted Integration
Point Claude Code, Cursor, Codex, or Antigravity at Trustlith canonical documentation. Generic docs contain zero secrets.
Prompt
Read https://developers.trustlith.com/TRUSTLITH-INTEGRATION.md (or TRUSTLITH-INTEGRATION.md at the repository root) and integrate Trustlith Public Runtime API v1 into our backend.
Requirements:
1. Keep TRUSTLITH_API_KEY strictly on the backend server; never expose API keys in frontend/mobile code.
2. Never send tenantId or applicationId overrides in POST /v1/challenges; set context.origin to match our registered Trustlith application origin.
3. Use action: "login" for login step-up or action: "fund_transfer" with transactionContext.type: "fund_transfer" for transfers. Do NOT call unimplemented V2 custom transaction routes.
4. Bind challengeId to the authenticated session, poll GET /v1/challenges/:id/status, support POST /v1/challenges/:id/cancel, and fail closed unless status === "APPROVED".
5. Add automated tests covering APPROVED, REJECTED, CANCELLED, EXPIRED, and API error responses.
AI Coding Agent Integration Guide
Trustlith supports AI-assisted integration out of the box using TRUSTLITH-INTEGRATION.md, llms.txt, and docs/openapi.yaml.
Quick Workflow for Developers Using Claude Code, Cursor, Codex, or Antigravity
- Download
TRUSTLITH-INTEGRATION.mdinto the root of your application repository (or download directly from Developer Portal → Documentation → Integrate with AI Agent). - Store
TRUSTLITH_API_KEY,TRUSTLITH_API_BASE_URL, andAPP_PUBLIC_ORIGINexclusively in your server.env/ secret store (never pass live secrets in AI chat prompts). - Paste the prompt below into your AI coding agent.
Recommended AI Agent Prompt
text
Read TRUSTLITH-INTEGRATION.md at the repository root and integrate Trustlith Public Runtime API v1 into our backend for <step-up login / fund transfer verification>.
Strict requirements:
1. Place all Trustlith API calls strictly on the server using process.env.TRUSTLITH_API_BASE_URL and process.env.TRUSTLITH_API_KEY. Never expose API keys to browser or client bundles.
2. Never send tenantId or applicationId in POST /v1/challenges payloads. Set context.origin to process.env.APP_PUBLIC_ORIGIN matching our registered Trustlith application origin.
3. Use action: "login" for login step-up or action: "fund_transfer" with transactionContext.type: "fund_transfer" for transfers. Do NOT use unimplemented V2 custom transaction endpoints.
4. Persist pending challengeId bound to the user's primary authenticated session, poll GET /v1/challenges/:id/status from the server, support POST /v1/challenges/:id/cancel, and fail closed unless status === "APPROVED".
5. Add unit/integration tests covering APPROVED, REJECTED, CANCELLED, EXPIRED, and error handling.Mandatory Verification Checklist After AI Generation
- [ ] Grep client/browser bundle directories to confirm
TRUSTLITH_API_KEYnever appears client-side. - [ ] Confirm
POST /v1/challengesrequest contains notenantIdorapplicationIdkeys. - [ ] Confirm
fund_transferrequests include literaltransactionContext.type === "fund_transfer"and 2-decimal stringamount. - [ ] Confirm protected backend actions fail closed when
statusisPENDING,REJECTED,CANCELLED, orEXPIRED. - [ ] Run end-to-end verification in Trustlith Portal → Test Authentication and Activity & Audit Logs.