TrustGraphSDK

Trust Graph SDK

TypeScript SDK for graph keys, signed trust edges, reachability queries, and proof verification.

Trust Graph SDK

@rebellion-systems/trust-graph-sdk is the TypeScript client for the trust graph service. It wraps the HTTP API and ships Node-side helpers for graph key IDs, node metadata, canonical edge payloads, and server-compatible ECDSA signatures.

The SDK follows the AuthenSee provider SDK style:

  • Explicit createTrustGraphSdk(...) client construction
  • Injectable fetch for tests, proxies, and edge runtimes
  • Strict response mappers that only expose the public API shape
  • TrustGraphSdkError for non-2xx responses
  • ESM and CJS builds from tsup
  • Vitest coverage around request construction, mapping, errors, crypto, and server integration

Environments

Staging:    https://trust-staging.rebellion.systems
Production: https://trust.rebellion.systems

Quick example

import {
  createTrustGraphSdk,
  signEdgeCertificatePayload,
  type EdgeCertificatePayload,
} from "@rebellion-systems/trust-graph-sdk";
 
const trustGraph = createTrustGraphSdk({
  serverUrl: "https://trust.rebellion.systems",
  authToken: async () => getAuthenSeeJwt(),
});
 
const graphKey = await trustGraph.registerGraphKey({
  publicKeyJwk,
  label: "work laptop",
  nodeKind: "human",
  authenseePersonaId: "per_123",
  providerPersonaIdDerivative: "ppid_derivative_123",
});
 
const payload: EdgeCertificatePayload = {
  signerGraphKeyId: graphKey.graphKeyId,
  subjectGraphKeyId: subjectGraphKeyId,
  trust: 80,
  scope: "identity",
  createdAt: new Date().toISOString(),
  nonce: crypto.randomUUID(),
};
 
await trustGraph.requestEdge({
  ...payload,
  signature: signEdgeCertificatePayload(privateKey, payload),
});

On this page