Skip to main content

ProviderConfig

@dopt/react / Exports / ProviderConfig

Interface: ProviderConfig

Providing this configuration to the DoptProvider allows the the SDK to fetch relevant data from the Dopt blocks API.

Table of contents

Properties

Properties

userId

userId: undefined | string

The userId you're fetching block and flows for.

Defined in

packages/@dopt/react/src/types.ts:64


groupId

Optional groupId: string

An optional groupId for that userId.

Defined in

packages/@dopt/react/src/types.ts:68


apiKey

apiKey: string

Your blocks API key.

Defined in

packages/@dopt/react/src/types.ts:72


logLevel

Optional logLevel: LogLevels

Defined in

packages/@dopt/react/src/types.ts:73


flows

Optional flows: Record<string, number | "uncommitted" | "latest">

An object containing all flows and versions you'd like to fetch.

The versions can be a number (a fixed version), "uncommitted" which references the uncommitted version in Dopt, or "latest" which references the most recently created version in Dopt.

Remarks

⚠️ Warning ⚠️: Using either "uncommitted" or "latest" will cause updates made in Dopt to be reflected in the provider upon window reload without needing to update or deploy code.

Example

{
"welcome-to-dopt": 3,
"test-flow": "uncommitted",
"feature-announcements": "latest",
};

Defined in

packages/@dopt/react/src/types.ts:96


flowVersions

Optional flowVersions: Record<string, number | "uncommitted" | "latest">

Deprecated

This property was renamed to flows. Please use that property instead.

Defined in

packages/@dopt/react/src/types.ts:101


channels

Optional channels: string[]

Defined in

packages/@dopt/react/src/types.ts:103


optimisticUpdates

Optional optimisticUpdates: boolean

A boolean which defines whether transitions on step blocks should optimistically update the client before hearing back that the change has been committed.

Within DoptProvider, this defaults to true.

Defined in

packages/@dopt/react/src/types.ts:111


children

Optional children: ReactNode

The children React elements of the DoptProvider.

Defined in

packages/@dopt/react/src/types.ts:115