Skip to content

Context

Port: REST :3040 · gRPC :5040

Stores application-wide and per-user configuration data. The two collections serve different scopes: configs for entity-scoped platform behavior switches, settings for user-scoped preferences.

Collections

CollectionPathPurpose
Configs/context/configsEntity-scoped configuration (RBAC, CQRS, feature flags)
Settings/context/settingsUser-scoped preference storage

context/configs

Stores configuration entries scoped to an entity ID — a client, app, or user. This is also the registry for all CQRS webhook endpoints.

Required Create Fields

FieldRequiredTypeDescription
keyConfigKeyControlled enum key
eidMongoIdTarget entity ID (uid, aid, or cid)

Optional Fields

FieldTypeDescription
valueJSONFree-form JSON value
statusStatusACTIVE or INACTIVE

Known ConfigKey Values

KeyPurpose
RBACRole-based access control rules for the target entity
CQRSCQRS webhook registration — value.webhook is the target URL
Collection keyse.g. auth/apts, identity/users, financial/wallets — per-collection config

CQRS Registration Example

typescript
await platform.context.configs.create({
  key: 'CQRS',
  eid: '<client_id>',
  value: { webhook: 'http://my-client.com/cqrs' },
})

Changing RBAC config affects permission resolution platform-wide for the target entity. Always confirm before updating.

context/settings

Stores typed user preference records.

Required Create Fields

FieldRequiredTypeDescription
keystringSetting name (uppercase + underscore pattern)
typeValueTypeDeclared value type

Optional Fields

FieldTypeDescription
valueJSONValue matching the declared type
statusStatusACTIVE or INACTIVE

ValueType Values

NULL, ARRAY, OBJECT, STRING, NUMBER, BOOLEAN

Key Behaviors

  • Use find_one before creating a new setting — prefer updating an existing record over creating duplicates.
  • Use ?zone=own,client for current-user preference lookups.