Skip to content

SynapseOptions

Defined in: packages/synapse-sdk/src/types.ts:91

Options for initializing the Synapse instance

account: `0x${string}` | Account

Defined in: packages/synapse-sdk/src/types.ts:111

Viem account


optional chain?: Chain

Defined in: packages/synapse-sdk/src/types.ts:103

Filecoin chain


optional requiredPermissions?: Permission[]

Defined in: packages/synapse-sdk/src/types.ts:129

The set of session key permissions Synapse.create validates as authorized and unexpired.

Defaults to SessionKey.DefaultFwssPermissions (all four FWSS permissions: CreateDataSet, AddPieces, SchedulePieceRemovals, TerminateService), which matches the operations exposed by the high-level Synapse class.

Pass a narrower array (e.g. [CreateDataSetPermission, AddPiecesPermission]) to keep least-privilege session keys on the Synapse.create happy path when the app only exercises a subset of the SDK surface. Operations whose permissions are not listed here will revert on-chain if attempted; the SDK does not enforce per-operation checks.

Only meaningful together with sessionKey.


optional sessionKey?: SessionKey<"Secp256k1">

Defined in: packages/synapse-sdk/src/types.ts:113


source: string | null

Defined in: packages/synapse-sdk/src/types.ts:139

Application identifier for namespace isolation. When set to a non-empty string, datasets are tagged with this value and only datasets with a matching source are reused. Set to null to explicitly opt out.


optional transport?: Transport

Defined in: packages/synapse-sdk/src/types.ts:97

Viem transport

https://viem.sh/docs/clients/intro#transports


optional withCDN?: boolean

Defined in: packages/synapse-sdk/src/types.ts:132

Whether to use CDN for retrievals (default: false)