Connect to River using a Bearer Token River clients can use this to connect to River on behalf of a user

Useful for server side code: you can persist the bearer token and use it to auth with River later

Imports

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

Definition

function connectRiverWithBearerToken(
  token: string,
  config: Omit<SyncAgentConfig, 'context'>,
): Promise<SyncAgent>

Source: connectRiverWithBearerToken

Parameters

token

  • Type: string

The bearer token to use

config

  • Type: Omit<SyncAgentConfig, 'context'>

The configuration for the sync agent

Return Type

The sync agent

Promise<SyncAgent>