API Reference
Client methods, inputs, outputs, and error behavior for the trust graph SDK.
API Reference
createTrustGraphSdk(options)
| Option | Type | Description |
|---|---|---|
serverUrl | string | Trust graph service base URL. Trailing slashes are normalized. |
authToken | string | () => string | Promise<string> | Optional bearer token or token provider. |
fetch | FetchLike | Optional fetch-compatible implementation. |
Authenticated Methods
These methods send Authorization: Bearer <token> when a token is configured:
registerGraphKey(input, options?)listMyGraphKeys(options?)confirmEdge(edgeId, options?)revokeEdge(edgeId, options?)
registerGraphKey
Returns GraphKey.
nodeKind is "human" or "agent" and defaults to "human". Persona fields
are optional so providers can choose the least revealing stable identifier:
| Field | Description |
|---|---|
authenseePersonaId | AuthenSee persona identifier when the caller is allowed to expose it to the graph service. |
providerPersonaId | Provider-local persona ID, if the provider wants it queryable. |
providerPersonaIdDerivative | Preferred privacy-preserving provider-specific derivative. |
metadata | JSON object for display names, capabilities, app-local tags, or other non-secret metadata. |
listMyGraphKeys
Returns GraphKey[].
confirmEdge
Returns { edge, graphEpochRoot, eventLogRoot }.
revokeEdge
Returns { edge, graphEpochRoot, eventLogRoot }.
Public Methods
These methods deliberately do not send the configured bearer token:
requestEdge(input)listEdges(query?)getCurrentEpoch()queryReachability(input)verifyProof(input)
requestEdge
Returns { edge, graphEpochRoot, eventLogRoot }.
listEdges
Returns every edge where graphKeyId is signer or subject. With no query, it
returns all visible edges.
getCurrentEpoch
Returns { graphEpochRoot, eventLogRoot }.
queryReachability
Returns:
verifyProof
Returns { valid, warning }.
Errors
Non-2xx responses throw TrustGraphSdkError:
The SDK maps both trust graph { error } responses and structured validation
responses with { code, message, issues }.