Skip to content

Commit e4deb69

Browse files
docs: align Node SDK REST docs, hide Agents/Memory, expand overview (#229)
- backend-sdks/node.mdx: mirror the Python SDK REST API doc updates — link Velt's REST APIs, split init into Self-hosting/REST API tabs, and move field-filtering details into inline notes per service section. - backend-sdks/node.mdx + python.mdx: comment out the Agents and Memory REST sections instead of deleting them (preserved in source). - get-started/overview.mdx: add missing top-level features — Activity Logs, Suggestions, Multiplayer Editing, Video Player Sync, and a new AI section (Rewriter, Approval Engine, Agent Comments, Chat SDK Adapter). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b400b48 commit e4deb69

3 files changed

Lines changed: 95 additions & 64 deletions

File tree

backend-sdks/node.mdx

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The [Velt Node SDK](https://www.npmjs.com/package/@veltdev/node) exposes two ind
1818
2. Call the relevant SDK method with the raw request payload
1919
3. Return the resulting response directly to the client
2020

21-
**REST API backend** (`sdk.api.*`) provides feature parity with the Velt Python SDK. 20 services, fully-typed TypeScript request objects, and raw Velt API responses. No database or AWS configuration needed.
21+
**REST API backend** (`sdk.api.*`) provides parity with [Velt's REST APIs](/api-reference/rest-apis/v2/organizations/get-organizations-v2). 18 services, fully-typed TypeScript request objects, and raw Velt API responses. No database or AWS configuration needed.
2222

2323
## Installation
2424

@@ -44,7 +44,10 @@ npm install @aws-sdk/client-s3 # required only if using S3 for attachments
4444

4545
### Initialize the SDK
4646

47-
**Self-hosting initialization** (MongoDB + optional AWS):
47+
<Tabs>
48+
<Tab title="Self-hosting">
49+
50+
Self-hosting initialization (MongoDB + optional AWS):
4851

4952
```ts
5053
import { VeltSDK } from '@veltdev/node';
@@ -62,7 +65,10 @@ const sdk = VeltSDK.initialize({
6265
});
6366
```
6467

65-
**REST API-only initialization** (no database needed):
68+
</Tab>
69+
<Tab title="REST API">
70+
71+
REST API-only initialization (no database needed):
6672

6773
```ts
6874
import { VeltSDK } from '@veltdev/node';
@@ -78,6 +84,9 @@ const result = await sdk.api.organizations.getOrganizations({ organizationIds: [
7884

7985
The `database` section is optional when using only `sdk.api.*`. Set `VELT_API_KEY` and `VELT_AUTH_TOKEN` environment variables as an alternative to passing credentials in the config object.
8086

87+
</Tab>
88+
</Tabs>
89+
8190
### Shutdown
8291

8392
Call `await sdk.close()` when your process exits to release the database connection pool.
@@ -622,18 +631,13 @@ const token = (tokenResult.data as { token: string }).token;
622631

623632
## REST API Backend
624633

625-
The `sdk.api.*` namespace provides 20 services covering all Velt REST API operations. No database or AWS configuration is required — only `apiKey` and `authToken`.
634+
The `sdk.api.*` namespace gives you parity with [Velt's REST APIs](/api-reference/rest-apis/v2/organizations/get-organizations-v2) across 18 services. Each method takes a fully-typed TypeScript request object and returns the raw Velt API response. You only need `apiKey` and `authToken` — no database or AWS config.
626635

627636
Every `sdk.api.*` method requires an `organizationId` in its request payload. Velt enforces data isolation per-organization server-side.
628637

629638
### Field Allowlist
630639

631-
Added in **v1.0.4**. The REST add/update methods on `activities`, `commentAnnotations`, and `notifications` accept an optional second argument, `FieldFilterOptions`. When `{ filterUnknownFields: true }` is passed, the SDK narrows the request to exactly the fields the corresponding Velt backend endpoint accepts, silently dropping unknown keys at each described level before sending.
632-
633-
- Opt-in and off by default — omitting `options` (or passing `filterUnknownFields: false`) sends the request unchanged, exactly as before.
634-
- Fail-open — if filtering hits any unexpected error, the original request is sent unchanged, so a filter bug can never block a write.
635-
- Top-level / fail-closed within a level — only listed keys survive at each described level, but nested open-typed objects (e.g. `actionUser`, `context`, `metadata`) pass through whole rather than being recursively narrowed.
636-
- Allowlists are transcribed by hand from the Velt backend Zod schemas (lock-step with the velt-py SDK's self-hosting field allowlist).
640+
The REST add/update methods on `activities`, `commentAnnotations`, and `notifications` accept an optional second argument, `FieldFilterOptions`. Pass `{ filterUnknownFields: true }` to narrow the request to exactly the fields the corresponding Velt backend endpoint accepts. See the note at the top of each service section for the behavior summary; the per-endpoint field lists are below.
637641

638642
```ts
639643
interface FieldFilterOptions {
@@ -643,42 +647,6 @@ interface FieldFilterOptions {
643647
}
644648
```
645649

646-
The 8 methods that accept it:
647-
648-
```ts
649-
// Activities
650-
sdk.api.activities.addActivities(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
651-
sdk.api.activities.updateActivities(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
652-
// Comment annotations + comments
653-
sdk.api.commentAnnotations.addCommentAnnotations(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
654-
sdk.api.commentAnnotations.updateCommentAnnotations(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
655-
sdk.api.commentAnnotations.addComments(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
656-
sdk.api.commentAnnotations.updateComments(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
657-
// Notifications
658-
sdk.api.notifications.addNotifications(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
659-
sdk.api.notifications.updateNotifications(request, options?: FieldFilterOptions): Promise<VeltApiResponse>;
660-
```
661-
662-
**Example**
663-
664-
```ts
665-
// Extra fields (internalId) are dropped before the request is sent.
666-
await sdk.api.commentAnnotations.addCommentAnnotations(
667-
{
668-
organizationId: 'org-123',
669-
documentId: 'doc-1',
670-
commentAnnotations: [
671-
{
672-
location: { id: 'section-1' },
673-
commentData: [{ commentText: 'Review this', from: { userId: 'user-1' } }],
674-
internalId: 'app-specific-field', // dropped when filtering is enabled
675-
},
676-
],
677-
},
678-
{ filterUnknownFields: true },
679-
);
680-
```
681-
682650
#### Exported filter utilities
683651

684652
The field-allowlist module is exported from `@veltdev/node` so advanced callers can reuse the same logic.
@@ -1477,12 +1445,16 @@ await sdk.api.userGroups.deleteUsersFromGroup({
14771445
14781446
**Namespace:** `sdk.api.notifications`
14791447
1448+
<Note>
1449+
**Filtering unknown fields**: The add/update methods below accept an optional `options?: FieldFilterOptions` second argument. When `{ filterUnknownFields: true }` is passed, unknown/custom keys are dropped before the request is sent, narrowing the payload to exactly the fields the Velt backend endpoint accepts. Open-typed objects (`actionUser`, `context`, `metadata`, user objects) pass through whole. Filtering is fail-open: if it errors, the original payload is sent, so a write is never blocked. `UPDATE_NOTIFICATIONS_SPEC` intentionally excludes `isRead`/`isArchived` — they are unsupported by `/v2/notifications/update`, so they are dropped when filtering is on. See [Field Allowlist](#field-allowlist) for the full per-endpoint field list.
1450+
</Note>
1451+
14801452
#### `addNotifications`
14811453
14821454
- Adds one or more notifications targeted to specific users.
14831455
- Params: [AddNotificationsRequest](/api-reference/sdk/models/data-models#addnotificationsrequest-node)
14841456
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1485-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1457+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
14861458
14871459
```ts
14881460
await sdk.api.notifications.addNotifications({
@@ -1545,7 +1517,7 @@ await sdk.api.notifications.getNotifications({
15451517
- Updates existing notifications (e.g., mark as read).
15461518
- Params: [UpdateNotificationsRequest](/api-reference/sdk/models/data-models#updatenotificationsrequest-node)
15471519
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1548-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1520+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
15491521
15501522
```ts
15511523
await sdk.api.notifications.updateNotifications({
@@ -1635,12 +1607,34 @@ await sdk.api.notifications.setNotificationConfig({
16351607
16361608
**Namespace:** `sdk.api.commentAnnotations`
16371609
1610+
<Note>
1611+
**Filtering unknown fields**: The add/update methods below accept an optional `options?: FieldFilterOptions` second argument. When `{ filterUnknownFields: true }` is passed, request entity collections are narrowed to only the fields the Velt backend endpoint accepts, dropping unknown/custom keys before the request is sent. Open-typed objects (`from`, `context`, `metadata`, user objects) pass through whole — their nested contents are never filtered. Filtering is fail-open: if it errors, the original payload is sent, so a write is never blocked. See [Field Allowlist](#field-allowlist) for the full per-endpoint field list.
1612+
</Note>
1613+
1614+
```ts
1615+
// Extra fields (internalId) are dropped before the request is sent.
1616+
await sdk.api.commentAnnotations.addCommentAnnotations(
1617+
{
1618+
organizationId: 'org-123',
1619+
documentId: 'doc-1',
1620+
commentAnnotations: [
1621+
{
1622+
location: { id: 'section-1' },
1623+
commentData: [{ commentText: 'Review this', from: { userId: 'user-1' } }],
1624+
internalId: 'app-specific-field', // dropped when filtering is enabled
1625+
},
1626+
],
1627+
},
1628+
{ filterUnknownFields: true },
1629+
);
1630+
```
1631+
16381632
#### `addCommentAnnotations`
16391633
16401634
- Creates comment annotations on a document.
16411635
- Params: [AddCommentAnnotationsRequest](/api-reference/sdk/models/data-models#addcommentannotationsrequest-node)
16421636
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1643-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1637+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
16441638
16451639
```ts
16461640
await sdk.api.commentAnnotations.addCommentAnnotations({
@@ -1738,7 +1732,7 @@ await sdk.api.commentAnnotations.getCommentAnnotationsCount({
17381732
- Updates fields on existing annotations (e.g., resolve them).
17391733
- Params: [UpdateCommentAnnotationsRequest](/api-reference/sdk/models/data-models#updatecommentannotationsrequest-node)
17401734
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1741-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1735+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
17421736
17431737
```ts
17441738
await sdk.api.commentAnnotations.updateCommentAnnotations({
@@ -1780,7 +1774,7 @@ await sdk.api.commentAnnotations.deleteCommentAnnotations({
17801774
- Adds comments to an existing annotation.
17811775
- Params: [AddCommentsRequest](/api-reference/sdk/models/data-models#addcommentsrequest-node)
17821776
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1783-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1777+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
17841778
17851779
```ts
17861780
await sdk.api.commentAnnotations.addComments({
@@ -1842,7 +1836,7 @@ await sdk.api.commentAnnotations.getComments({
18421836
- Updates comments within a specific annotation.
18431837
- Params: [UpdateCommentsRequest](/api-reference/sdk/models/data-models#updatecommentsrequest-node)
18441838
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1845-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1839+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
18461840
18471841
```ts
18481842
await sdk.api.commentAnnotations.updateComments({
@@ -1885,12 +1879,16 @@ await sdk.api.commentAnnotations.deleteComments({
18851879
18861880
**Namespace:** `sdk.api.activities`
18871881
1882+
<Note>
1883+
**Filtering unknown fields**: The add/update methods below accept an optional `options?: FieldFilterOptions` second argument. When `{ filterUnknownFields: true }` is passed, request entity collections are narrowed to only the fields the Velt backend endpoint accepts, dropping unknown/custom keys before the request is sent. Open-typed objects (`actionUser`, `entityData`, `context`, `metadata`) pass through whole — their nested contents are never filtered. Filtering is fail-open: if it errors, the original payload is sent, so a write is never blocked. See [Field Allowlist](#field-allowlist) for the full per-endpoint field list.
1884+
</Note>
1885+
18881886
#### `addActivities`
18891887
18901888
- Logs activity events.
18911889
- Params: [AddActivitiesRequest](/api-reference/sdk/models/data-models#addactivitiesrequest-node)
18921890
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1893-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1891+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
18941892
18951893
```ts
18961894
await sdk.api.activities.addActivities({
@@ -1956,7 +1954,7 @@ await sdk.api.activities.getActivities({
19561954
- Updates existing activity events.
19571955
- Params: [UpdateActivitiesRequest](/api-reference/sdk/models/data-models#updateactivitiesrequest-node)
19581956
- Returns: [VeltApiResponse](/api-reference/sdk/models/data-models#veltapiresponse-node)
1959-
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending. See [Field Allowlist](#field-allowlist).
1957+
- Accepts an optional `options?: FieldFilterOptions` second argument — pass `{ filterUnknownFields: true }` to drop unknown fields before sending (see the note above).
19601958
19611959
```ts
19621960
await sdk.api.activities.updateActivities({
@@ -3228,6 +3226,7 @@ await sdk.api.token.getToken('org-123', 'user-1', 'john@example.com', false);
32283226
}
32293227
```
32303228
3229+
{/*
32313230
### Agents
32323231
32333232
**Namespace:** `sdk.api.agents`
@@ -3493,8 +3492,8 @@ These shared/nested config interfaces are referenced by the request types above.
34933492
34943493
```ts
34953494
interface ResponseFieldDescriptions { summary?: string; title?: string; description?: string; severity?: string; targetText?: string; suggestion?: string; isPageLevel?: string; issueType?: string; confidence?: string; htmlSelector?: string; findingType?: string; }
3496-
interface KnowledgeConfig { useMemory?: boolean; maxChunks?: number; /* 1..20 */ maxPatterns?: number; /* 1..20 */ maxActivities?: number; /* 1..20 */ }
3497-
interface ContextGatheringConfig { strategies?: string[]; /* non-empty when present */ strategyOptions?: Record<string, Record<string, unknown>>; }
3495+
interface KnowledgeConfig { useMemory?: boolean; maxChunks?: number; /* 1..20 * / maxPatterns?: number; /* 1..20 * / maxActivities?: number; /* 1..20 * / }
3496+
interface ContextGatheringConfig { strategies?: string[]; /* non-empty when present * / strategyOptions?: Record<string, Record<string, unknown>>; }
34983497
interface AgentExecutionConfig { responseDescriptions?: ResponseFieldDescriptions; executionStrategy?: string; serviceId?: string; strategyOptions?: Record<string, Record<string, unknown>>; knowledge?: KnowledgeConfig; }
34993498
interface AgentResponseConfig { useAiFormatting?: boolean; formattingPrompt?: string; responseAdapter?: string; }
35003499
interface AgentPostProcessConfig { guardrails?: { enabled?: boolean }; matchAndMerge?: { enabled?: boolean }; pinResolution?: { enabled?: boolean }; annotations?: { enabled?: boolean; strategy?: string }; analytics?: { enabled?: boolean }; customProcessors?: string[]; }
@@ -3504,7 +3503,7 @@ interface AgentCrossPageConfig { enabled: boolean; targetProperty: string; pageD
35043503
interface AgentScopeConfig { pageScope?: string[]; pageScopeExclude?: string[]; contentTypes?: string[]; crossPage?: AgentCrossPageConfig; }
35053504
interface AgentSetupSampleFinding { message: string; elementSelector?: string; isCorrect?: boolean; }
35063505
interface AgentSetupSample { content: string; source: 'synthetic' | 'user-provided'; findings: AgentSetupSampleFinding[]; pmVerdict?: 'correct' | 'incorrect'; pmNotes?: string; }
3507-
interface AgentChecklistOrigin { checklistId: string; checklistVersion: number; /* int >= 0 */ sectionRefs: string[]; memoryRuleIds: string[]; deduplicatedFrom?: number; /* int >= 0 */ }
3506+
interface AgentChecklistOrigin { checklistId: string; checklistVersion: number; /* int >= 0 * / sectionRefs: string[]; memoryRuleIds: string[]; deduplicatedFrom?: number; /* int >= 0 * / }
35083507
interface AgentSetupConfig { setupSamples?: AgentSetupSample[]; checklistOrigin?: AgentChecklistOrigin; }
35093508
interface PromptUserContextField { id: string; title: string; type: string; example?: string; defaultValue?: string | number | boolean; }
35103509
interface PromptRefinerDemoFeedback { demoId: string; demoTitle: string; demoHtml: string; demoExpected: string; feedback: string; }
@@ -3766,10 +3765,11 @@ These shared/nested config interfaces are referenced by the request types above.
37663765
```ts
37673766
type MemoryKnowledgeMimeType = 'application/pdf' | 'text/csv' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'text/plain';
37683767
interface MemoryDateRange { start: string | number; end: string | number; } // ISO-8601 string or ms epoch; server enforces start <= end
3769-
interface MemorySearchFilters { decision?: string; judgeType?: string; contentType?: string; reviewerId?: string; annotationId?: string; /* non-empty when present; triggers annotation shortcut */ dateRange?: MemoryDateRange; }
3770-
interface MemoryAlertConfig { enabled?: boolean; maxAlertsPerWeek?: number; /* int >= 0 */ enabledAlertTypes?: string[]; severityThreshold?: 'high' | 'medium' | 'low'; }
3771-
interface MemoryIngestInlineFile { base64: string; mimeType: MemoryKnowledgeMimeType; fileName: string; /* 1..255 */ fileSize: number; /* positive int, <= 5,242,880 (5 MB) */ }
3768+
interface MemorySearchFilters { decision?: string; judgeType?: string; contentType?: string; reviewerId?: string; annotationId?: string; /* non-empty when present; triggers annotation shortcut * / dateRange?: MemoryDateRange; }
3769+
interface MemoryAlertConfig { enabled?: boolean; maxAlertsPerWeek?: number; /* int >= 0 * / enabledAlertTypes?: string[]; severityThreshold?: 'high' | 'medium' | 'low'; }
3770+
interface MemoryIngestInlineFile { base64: string; mimeType: MemoryKnowledgeMimeType; fileName: string; /* 1..255 * / fileSize: number; /* positive int, <= 5,242,880 (5 MB) * / }
37723771
```
3772+
*/}
37733773

37743774
### Approval Workflows
37753775

0 commit comments

Comments
 (0)