Compliance Forms
Compliance Forms — methods, parameters, and examples for @easylabs/node.
Compliance forms (e.g. card-network agreements, sponsor disclosures) are issued to your company by Easy Labs and must be signed before certain product capabilities are unlocked. The SDK lets you list pending and historical forms, fetch one by ID, and submit a signature.
Methods
easy.listComplianceForms(); // GET /compliance-forms
easy.getComplianceForm(formId); // GET /compliance-forms/:id
easy.signComplianceForm(formId, body); // PUT /compliance-forms/:id/signconst forms = await easy.listComplianceForms();
const pending = forms.data.filter((f) => f.status !== "signed");
for (const f of pending) {
await easy.signComplianceForm(f.id, {
name: "Ada Lovelace",
title: "CEO",
});
}Object shape
ComplianceFormData:
| Field | Type | Notes |
|---|---|---|
id | string | |
type | string | The form template, e.g. card-network terms. |
status | string | pending, signed, etc. |
signed_at | string | null | ISO timestamp. |
signed_name / signed_title | string | null | |
due_at | string | null | Deadline before features lock. |
metadata | Record<string, unknown> |
SignComplianceForm body: { name: string; title: string }.
Examples
Block deploys when a form is overdue
const forms = await easy.listComplianceForms();
const overdue = forms.data.filter(
(f) => f.status !== "signed" && f.due_at && Date.parse(f.due_at) < Date.now(),
);
if (overdue.length) {
throw new Error(`Sign these compliance forms first: ${overdue.map((f) => f.type).join(", ")}`);
}Audit who signed what
const forms = await easy.listComplianceForms();
console.table(
forms.data.filter((f) => f.signed_at).map((f) => ({
type: f.type,
signed_by: `${f.signed_name} (${f.signed_title})`,
signed_at: f.signed_at,
})),
);