Skip to content

js-bao-wss-client


js-bao-wss-client / CreateCollectionParams

Interface: CreateCollectionParams ​

Parameters for collections.create().

Properties ​

collectionType? ​

optional collectionType?: string

Optional. Controls which CollectionTypeConfig / rule set applies to the new collection. Defaults to "default" when omitted. Must not contain "#". Immutable after create.


contextId? ​

optional contextId?: string

Optional. Per-instance identifier that ties the collection to an external entity (e.g. a class ID). Exposed to CEL rules as collection.contextId. Must not contain "#". Immutable after create.

Deprecated ​

Prefer resource metadata categories. Stamp the binding via initialMetadata and read it from CEL as md.self.<category>.<key>. The migration is not 1:1: a rule set can read md.self.<category>.<key> only when the collection type config declares a metadataManifest for that category. See collections.md. The field keeps working.


description? ​

optional description?: string

Optional text describing the collection's purpose


initialMetadata? ​

optional initialMetadata?: Record<string, Record<string, unknown>>

Optional. Create-time resource metadata to stamp on the new collection, keyed by category name → the category's values. Each entry is schema-validated but the category writeRule is waived — creation authority covers the initial stamp. At most 10 categories; any invalid entry fails the whole create.


name ​

name: string

Display name for the collection

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30