Skip to main content
The JadeProvider component provides Jade SDK context to your application. Wrap your app with this provider to use Jade hooks.

Import

Basic Usage

Props

config

JadeClientConfig
required
Configuration object for the Jade client.

storage (React Native only)

StorageAdapter
Storage adapter for persisting data locally. Required for React Native to enable session persistence.
See React Native Guide for more storage options.

pauseOnBackground (React Native only)

boolean
default:"true"
Whether to pause streaming when the app goes to background.

Configuration Options

Async Authentication

Organization Context

Custom Fetch Options (Web only)

Accessing the Client

Use the client hook to access the underlying client directly:

React Native-Specific Hooks

The React Native provider also exposes these additional hooks:

useStorage

Get the storage adapter:

useAppState

Get the current app state:

Multiple Providers

You can use multiple providers for different configurations:
Each JadeProvider creates its own client instance. Hooks will use the nearest provider in the component tree.

TypeScript

Import types from the appropriate package: