65910a3ad61d414d1c6dc8f4d32f7e80a898e57c
TypeScript SDK for Elydora agent operations, cryptographic signing, and audit trail integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@elydora/sdk
Node.js/TypeScript SDK for the Elydora tamper-evident audit platform.
Installation
npm install @elydora/sdk
Requires Node.js 18+ (uses built-in crypto module with Ed25519 support).
Quick Start
import { ElydoraClient } from '@elydora/sdk';
// 1. Authenticate
const auth = await ElydoraClient.login('https://api.elydora.com', 'user@example.com', 'password');
// 2. Create client
const client = new ElydoraClient({
orgId: auth.user.org_id,
agentId: 'my-agent-id',
privateKey: '<base64url-encoded-32-byte-ed25519-seed>',
baseUrl: 'https://api.elydora.com',
});
client.setToken(auth.token);
// 3. Create and submit an operation
const eor = client.createOperation({
operationType: 'data.access',
subject: { user_id: 'u-123', resource: 'patient-record' },
action: { type: 'read', scope: 'full' },
payload: { record_id: 'rec-456' },
});
const { receipt } = await client.submitOperation(eor);
console.log('Operation submitted:', receipt.operation_id);
API Reference
Static Methods
ElydoraClient.register(baseUrl, email, password, displayName?, orgName?)— Register a new user and organizationElydoraClient.login(baseUrl, email, password)— Authenticate and receive a JWT
Instance Methods
Agent Management
registerAgent(request)— Register a new agent with public keysgetAgent(agentId)— Retrieve agent detailsfreezeAgent(agentId, reason)— Freeze an agentrevokeKey(agentId, kid, reason)— Revoke an agent key
Operations
createOperation(params)— Construct and sign an EOR locally (synchronous)submitOperation(eor)— Submit a signed EOR to the APIgetOperation(operationId)— Retrieve an operationverifyOperation(operationId)— Verify operation integrity
Audit
queryAudit(params)— Query the audit log
Epochs
listEpochs()— List all epochsgetEpoch(epochId)— Retrieve an epoch
Exports
createExport(params)— Create a compliance exportlistExports()— List all exportsgetExport(exportId)— Retrieve export status
JWKS
getJWKS()— Retrieve platform public keys
Cryptographic Details
- Ed25519: Signs operations using Node.js built-in
cryptomodule - Chain hashing:
SHA-256(prev_chain_hash | payload_hash | operation_id | issued_at) - JCS: RFC 8785 JSON Canonicalization Scheme for deterministic serialization
- Base64url: RFC 4648 section 5, no padding
License
MIT
Languages
JavaScript
52.6%
TypeScript
47.4%