Provides the sync agent to all hooks usage that interacts with the River network.

  • If you want to interact with the sync agent directly, you can use the useSyncAgent hook. - If you want to interact with the River network using hooks provided by this SDK, you should wrap your App with this provider.

You can pass an initial sync agent instance to the provider. This can be useful for persisting authentication.

Imports

import { RiverSyncProvider } from '@river-build/react-sdk'

Definition

function RiverSyncProvider(
  props: {
    syncAgent?: SyncAgent;
    config?: {
        onTokenExpired?: () => void;
    };
    children?: React.ReactNode;
},
): JSX.Element

Source: RiverSyncProvider

Parameters

props

  • Type: { syncAgent?: SyncAgent; config?: { onTokenExpired?: () => void; }; children?: React.ReactNode; }

The props for the provider

Return Type

The provider

JSX.Element