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

# LayerProvider context

All Layer React components are nested under the `LayerProvider` component. This component takes in the below properties.

```tsx theme={null}
<LayerProvider
  businessId="<layer_business_id>"
  businessAccessToken="<access_token>"
  environment={'sandbox'}
  onError={error => {
    console.error('Layer error:', error)
  }}
  eventCallbacks={{
    onTransactionCategorized: (transactionId: string) => {
      console.log('Transaction categorized', transactionId)
    },
  }}
>
  {...}
</LayerProvider>
```

### Properties

<ParamField body="businessId" required="true" type="string">
  The ID of the business whose infomation you're showing.
</ParamField>

<ParamField body="businessAccessToken" required="true" type="string">
  Temporary authentication token scoped to this specific business. See the getting started guide for how to fetch these tokens on your backend.
  <Info>Do not use your Layer API key as the token in production. Retrieve a business-scoped access token from the Layer API and pass that value here instead.</Info>
</ParamField>

<ParamField body="environment" type="string">
  The Layer environment you're attempting to access. Can be `sandbox` or `production`. Defaults to defaults to `production`.
</ParamField>

<ParamField body="theme" type="string">
  Customizes the look and feel of the components.
</ParamField>

<ParamField body="onError" type="string">
  Callback to be notified about exceptions within the components.
</ParamField>

<ParamField body="eventCallbacks" type="object">
  Callbacks that will be triggered for specific user events within the components.

  <Expandable title="props">
    <ResponseField name="onTransactionCategorized" type="`(transactionId: string) => void`">
      Callback triggered any time a transaction is categorized, matched, updated, etc.
    </ResponseField>

    <ResponseField name="onTransactionsFetched" type="`() => void`">
      Callback triggered when new transactions are fetched.
    </ResponseField>
  </Expandable>
</ParamField>
