Reference
SDK Reference
The credian package is a zero-dependency TypeScript SDK for Node 18+. It supports both ESM and CommonJS.
Client initialization
Options: baseUrl, timeout (ms, default 30000), retries (default 3).
client.agents
Register, update, and manage agents. Owner auth required for write operations.
agents.register(input)→Agent & { apiKey }Register a new agent. Returns the agent with a one-time API key.
agents.get(agentId)→AgentGet an agent's profile by ID.
agents.update(agentId, input)→AgentUpdate agent metadata or display name.
agents.deactivate(agentId)→voidDeactivate an agent. Owner auth required.
client.score
Query trust scores. Score lookups are public and rate-limited.
score.get(agentId)→AgentScoreCurrent score with breakdown (reliability, financial, identity), confidence, classification.
score.getHistory(agentId, options?)→ScoreSnapshot[]Historical score snapshots. Options: from, to, limit.
score.getBatch(agentIds)→Map<string, AgentScore>Batch lookup for up to 100 agents.
client.events
Report behavioral events that feed into trust scores.
events.report(agentId, events)→{ accepted, rejected, errors? }Submit one or more events. Returns counts of accepted and rejected.
events.list(agentId, options?)→Event[]Get event history. Options: type, from, to, cursor, limit.
client.credentials
Issue and verify trust credentials for agents.
credentials.issue(input)→CredentialIssue a credential. Includes agentId, type, claims, expiresAt.
credentials.verify(credentialId)→{ valid, status, claims }Verify a credential is active and not expired/revoked.
credentials.get(credentialId)→CredentialGet full credential details.
credentials.revoke(credentialId)→voidRevoke a previously issued credential.
client.webhooks
Manage webhook subscriptions. Owner auth required.
webhooks.create(input)→WebhookSubscriptionCreate a subscription with a URL and list of event types.
webhooks.list()→WebhookSubscription[]List all active subscriptions.
webhooks.delete(subscriptionId)→voidDelete a webhook subscription.
Error handling
All errors include code, message, details, and status.