Skip to main content

Overview

The Suki Web SDK provides PlatformClient and PlatformClientProvider to help you integrate Suki Headless Web SDK functionality into your application. PlatformClient The PlatformClient acts as the shared runtime object for the SDK within your app. You should create a single instance of this object and reuse it throughout your application to ensure consistency. PlatformClientProvider The PlatformClientProvider is a React wrapper that makes your PlatformClient instance available to all child components. This allows you to use Suki hooks, such as useAuth, useAmbient, and useAmbientSession, to build your integration quickly.

PlatformClient

Import

Before you can use the PlatformClient, you need to import it into your application.
React
import { PlatformClient } from '@suki-sdk/platform-react';

function App() {
  return <PlatformClientProvider client={platformClient}>
<YourApp />
</PlatformClientProvider>;
}

Creating an instance

Create the client once for your app (for example at module scope or outside your root component) so it is not recreated on every render.
React
const client = new PlatformClient({
  env: "staging",
  enableDebug: true,
  logLevel: "error"
});
The object you pass to new PlatformClient({ ... }) sets how that client behaves for your app.

Configuration

These are the settings you pass when you call new PlatformClient({ ... }) in your application.
env
string
The Suki environment the client targets. Examples in this documentation use "staging".
enableDebug
boolean
When true, the client runs in a debug-oriented mode so you can troubleshoot during development. Use false when you do not want that behavior in production.
logLevel
string
The logging level for the client. Examples in this documentation use "error".

PlatformClientProvider

Before you can use the PlatformClientProvider, you need to import it into your application.
import { PlatformClientProvider } from '@suki-sdk/platform-react';

Wrap your app

Create a single PlatformClient instance and wrap your application with PlatformClientProvider. Hooks such as useAuth, useAmbient, and useAmbientSession must run under this provider.
To use Headless Web SDK, you must wrap your app with PlatformClientProvider above any component that calls Headless Web SDK hooks. Those hooks read the shared PlatformClient from React context that the provider supplies.Refer to the Quickstart for a full component tree and useAuth example.

Next steps

Quickstart

Install, provider, useAuth, and ambient flow

Types Overview

Index of all Headless Web SDK type reference pages

Authentication Hook

useAuth configuration and behavior

UseAuth Parameters

TypeScript shape for useAuth options
Last modified on April 20, 2026