> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priceos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# <PriceOSProvider />

> Provider component for your React application.

`PriceOSProvider` configures auth and backend settings for all PriceOS React hooks.

<Tip>
  Set up backend handlers first with [React integration guide](/react-integration).
</Tip>

## Usage

```tsx theme={null}
import { PriceOSProvider } from "priceos/react";

export function AppProviders({ children }: { children: React.ReactNode }) {
  return (
    <PriceOSProvider>
      {children}
    </PriceOSProvider>
  );
}
```

## Parameters

<ParamField path="children" type="ReactNode" required>
  Your app tree that will use PriceOS hooks.
</ParamField>

<ParamField path="getBearerToken" type="function">
  Returns a bearer token that is sent as `Authorization: Bearer ...` to your backend handler routes.
  Type: `() => Promise<string | null | undefined>`.
  Use this when your backend requires authenticated requests.
</ParamField>

<ParamField path="backendUrl" type="string">
  Base URL for your PriceOS handler routes.
  Default: `/api/priceos`.
  Use this if your handlers are mounted somewhere else, for example `https://api.yourapp.com/priceos`.
</ParamField>

<ParamField path="logLevel" type="string">
  Controls SDK logging output in the browser.
  Allowed values: `"none" | "error" | "warn" | "info" | "debug"`.
  Default: `"error"`.
</ParamField>

## Full example

```tsx theme={null}
import { PriceOSProvider } from "priceos/react";

export function AppProviders({ children }: { children: React.ReactNode }) {
  return (
    <PriceOSProvider
      backendUrl="https://api.yourapp.com/priceos"
      getBearerToken={async () => authUser?.getIdToken()}
      logLevel="error"
    >
      {children}
    </PriceOSProvider>
  );
}
```
