Credit & Passport
Credit and Passport quickstart
Sign and send a real private-beta partner request without depending on an unpublished package.
1. Keep credentials server-side
Environment
FULLNESS_CREDIT_API_BASE=https://sandbox-host-issued-during-onboarding
FULLNESS_CREDIT_API_KEY=prefix.secret2. Sign the exact body
Node.js
import { createHmac } from 'node:crypto';
const baseUrl = process.env.FULLNESS_CREDIT_API_BASE;
const apiKey = process.env.FULLNESS_CREDIT_API_KEY;
const secret = apiKey.slice(apiKey.indexOf('.') + 1);
const body = JSON.stringify({
did: 'did:fullness:subject-issued-by-fullness',
consent_token: 'consent-token-issued-for-this-release',
});
const signature = 'sha256=' + createHmac('sha256', secret)
.update(body, 'utf8')
.digest('hex');3. Send a score request
Node.js
const response = await fetch(
baseUrl + '/api/credit-api/v1/score',
{
method: 'POST',
headers: {
'content-type': 'application/json',
'x-api-key': apiKey,
'x-signature': signature,
'x-data-use-purpose': 'credit_scoring',
},
body,
},
);
const payload = await response.json();
if (!response.ok) throw new Error(payload.error?.code || 'CREDIT_API_ERROR');
console.log(payload.attestation);