Developer docs
Seal your first agent action.
Add RANKIGI beside an agent, submit one witnessed event, and verify the resulting chain outside RANKIGI.
npm install @rankigi/sdk01
Install the SDK
Add RANKIGI to the agent runtime.
02
Wrap one action
Inputs and outputs are hashed, signed, and chained.
03
Export the proof
Download the chain bundle for review.
04
Verify locally
Recompute the chain without trusting RANKIGI.
Quickstart
One wrapped function becomes a receipt.
The SDK is non-blocking. If RANKIGI is unavailable, your agent continues and the SDK records the transport failure.
# Enroll an agent and write .env automatically (recommended):
npx @rankigi/cli init
# That writes one credential token, which Rankigi.fromEnv() reads:
RANKIGI_CREDENTIAL=rnk_live_cred_v1... # API key + agent + passport + signing key
RANKIGI_CHAIN_ID=... # optional
# Or set the four variables individually instead of RANKIGI_CREDENTIAL:
RANKIGI_API_KEY=... # from rankigi.com/dashboard/keys (same key the curl example uses)
RANKIGI_AGENT_ID=...
RANKIGI_PASSPORT_ID=...
RANKIGI_SIGNING_KEY=...import "dotenv/config";
import { Rankigi } from "@rankigi/sdk";
const rankigi = Rankigi.fromEnv();
const result = await rankigi.wrap(
"first-tool-call",
{ tool: "send_email", to: "customer@example.com" },
async () => {
return { status: "sent", provider_id: "msg_abc123" };
},
);
await rankigi.close();
console.log(result);Verification
Do not trust the dashboard.
Export the chain and recompute it locally. The browser verifier and verify.py are the same product promise in two forms.
Open browser verifier# Export a chain bundle from the dashboard, then verify it locally.
python3 verify.py chain-export.json
# Or paste the sample bundle into:
# https://rankigi.com/verifyAPI
Use HTTP when an SDK is too much.
The ingest API accepts minimal event metadata and payload hashes. Use the SDK when you need passport signing handled for you.
curl -X POST https://rankigi.com/api/ingest \
-H "Authorization: Bearer $RANKIGI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "your-agent-uuid",
"action": "tool_call",
"tool": "send_email",
"severity": "info",
"payload": {
"input": { "to": "customer@example.com" },
"output": { "status": "sent" }
}
}'References
Choose the shortest path.
Node.js SDK
Production SDK with retries, durable queue, Ed25519 signing, and non-blocking ingest.
OPEN
Python SDK
Python runtime support for scripts, workers, and agent pipelines.
OPEN
Browser verifier
Paste a sample chain export and recompute proof without an account.
OPEN
Trust model
Review storage, signing, hash-chain, and anchoring guarantees before production.
OPEN