CreateContextOptions
Defined in: packages/synapse-sdk/src/types.ts:334
Options for creating a single storage context
Used by StorageManager.createContext() and StorageContext.create().
Uses singular providerId and dataSetId to match the single-context semantics.
Example
Section titled “Example”// Create context for specific providerconst ctx = await storage.createContext({ providerId: 1n })
// Create context for specific data setconst ctx = await storage.createContext({ dataSetId: 5n })
// Let smart selection choose (with CDN enabled)const ctx = await storage.createContext({ withCDN: true })Extends
Section titled “Extends”Properties
Section titled “Properties”callbacks?
Section titled “callbacks?”
optionalcallbacks:StorageContextCallbacks
Defined in: packages/synapse-sdk/src/types.ts:313
Callbacks for context creation process
Inherited from
Section titled “Inherited from”dataSetId?
Section titled “dataSetId?”
optionaldataSetId:bigint
Defined in: packages/synapse-sdk/src/types.ts:360
Specific data set ID to use.
When provided:
- Context is created for this specific data set
- Data set must exist and belong to the current client
- Mutually exclusive with
providerId
Throws
Section titled “Throws”If data set does not exist or is not owned by client
Throws
Section titled “Throws”If combined with providerId
metadata?
Section titled “metadata?”
optionalmetadata:Record<string,string>
Defined in: packages/synapse-sdk/src/types.ts:310
Custom metadata for data sets (key-value pairs). Used to match existing data sets during provider selection or smart selection.
Inherited from
Section titled “Inherited from”providerId?
Section titled “providerId?”
optionalproviderId:bigint
Defined in: packages/synapse-sdk/src/types.ts:347
Specific provider ID to use.
When provided:
- Context is created for this specific provider
- Provider must exist in the registry
- Existing data set matching
metadatais reused when available - Mutually exclusive with
dataSetId
Throws
Section titled “Throws”If provider is not found in registry
Throws
Section titled “Throws”If combined with dataSetId
withCDN?
Section titled “withCDN?”
optionalwithCDN:boolean
Defined in: packages/synapse-sdk/src/types.ts:304
Whether to enable CDN services for the context