Skip to content

Manage Boundaries with the VB-OS Node.js SDK

The client.boundaries namespace provides methods for managing boundary definitions, their versions, and the review workflow.

Method Signature Description
list (projectId, opts?) List boundaries in a project
create (projectId, kwargs) Create a new boundary
get (projectId, boundaryRef) Get a boundary by reference
updateDraft (projectId, boundaryRef, kwargs) Update a draft boundary
submit (projectId, boundaryRef) Submit a boundary for review
versions (projectId, boundaryRef, opts?) List versions of a boundary
getVersion (projectId, boundaryRef, versionId) Get a specific version
approve (projectId, boundaryRef, versionId) Approve a version
reject (projectId, boundaryRef, versionId) Reject a version
diff (projectId, boundaryRef, kwargs) Diff two boundary versions
const boundaries = await client.boundaries.list('proj_abc123');
for (const b of boundaries.items) {
console.log(b.ref, b.name);
}

Pagination options:

const page = await client.boundaries.list('proj_abc123', {
limit: 10,
cursor: 'next_cursor_value',
});
const boundary = await client.boundaries.create('proj_abc123', {
name: 'KYC Boundary',
ref: 'kyc-boundary',
source: 'require_evidence: applicant_age\npredicate: of_age: applicant_age >= 18',
});
const boundary = await client.boundaries.get('proj_abc123', 'kyc-boundary');
await client.boundaries.updateDraft('proj_abc123', 'kyc-boundary', {
source: 'require_evidence: applicant_age\npredicate: of_age: applicant_age >= 21',
});
await client.boundaries.submit('proj_abc123', 'kyc-boundary');
// List versions
const versions = await client.boundaries.versions('proj_abc123', 'kyc-boundary');
// Get a specific version
const version = await client.boundaries.getVersion(
'proj_abc123',
'kyc-boundary',
'ver_abc123',
);
// Approve a version
await client.boundaries.approve('proj_abc123', 'kyc-boundary', 'ver_abc123');
// Reject a version
await client.boundaries.reject('proj_abc123', 'kyc-boundary', 'ver_abc123');
const diff = await client.boundaries.diff('proj_abc123', 'kyc-boundary', {
v1: 'ver_abc123',
v2: 'ver_def456',
});