-
Notifications
You must be signed in to change notification settings - Fork 0
SDK Usage
chrismaz11 edited this page Mar 12, 2026
·
1 revision
Navigation
- Home
- What is TrustSignal
- Architecture
- Verification Receipts
- API Overview
- Quick Verification Example
- Vanta Integration Example
The repository includes a JavaScript SDK published as @trustsignal/sdk.
The current SDK targets the /v1/* JWT-authenticated API surface:
POST /v1/verify-bundlePOST /v1/revokeGET /v1/status/:bundleId
For the /api/v1/* integration surface, use a standard HTTP client today.
The constructor option is named apiKey, but the SDK sends that value as a Bearer token to the /v1/* routes.
npm install @trustsignal/sdkimport { TrustSignalSDK } from '@trustsignal/sdk';
const client = new TrustSignalSDK({
baseUrl: 'https://api.trustsignal.example',
apiKey: process.env.TRUSTSIGNAL_API_KEY ?? ''
});const result = await client.verify({
deed_hash: '0x9ccf90f7b62f3ca69f1df442f9e44b6f95ad3f57f5f1d4dce5f35f7915d644a0',
text_length: 4821,
num_signatures: 3,
notary_present: true,
days_since_notarized: 11,
amount: 425000
});const revoked = await client.revoke(
'0x9ccf90f7b62f3ca69f1df442f9e44b6f95ad3f57f5f1d4dce5f35f7915d644a0',
'Court order'
);const status = await client.status(
'0x9ccf90f7b62f3ca69f1df442f9e44b6f95ad3f57f5f1d4dce5f35f7915d644a0'
);For receipt-oriented integrations, direct HTTP is currently the clearest option:
const response = await fetch('https://api.trustsignal.example/api/v1/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.TRUSTSIGNAL_API_KEY ?? ''
},
body: JSON.stringify(payload)
});
if (!response.ok) {
throw new Error(`TrustSignal verify failed: ${response.status}`);
}
const data = await response.json();- Use the SDK when you already depend on the
/v1/*bundle contract. - Use direct HTTP for the
/api/v1/*receipt lifecycle and Vanta-oriented flows. - Store identifiers returned by TrustSignal so you can retrieve and re-check receipts later.