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

# Troubleshooting

> Solutions for common SDK integration issues

If you encounter issues with the Reach SDK, check these common solutions.

## Authentication Issues

**Problem**: Token-related errors or 401 Unauthorized responses.

**Solutions**:

* Verify your JWT contains all required fields
* Check that your token is properly signed with the correct secret
* Ensure your token hasn't expired (we recommend 1-hour expiration)
* Confirm your `handleReauthRequested` callback is properly implemented

## SDK Initialization Problems

**Problem**: Errors when initializing the SDK or "ReachSDK is not defined".

**Solutions**:

```javascript theme={null}
// Wait for script to load before initializing
const script = document.createElement('script');
script.src = 'https://cdn.embedreach.com/iframe/sdk/sdk.es.js';
script.async = true;

script.onload = () => {
  // Only initialize after script has loaded
  const sdk = new window.ReachSDK(config);
};

document.body.appendChild(script);
```

<Warning>
  Certain web frameworks, including React/Next.js, can make it easy to
  accidentally initialize the SDK multiple times.
</Warning>

## Display Issues

**Problem:** The Reach interface doesn't display properly.

**Solutions:**

* Ensure the container element has sufficient dimensions (min-height: 500px recommended)
* Verify your theme configuration contains valid values
* Check for CSS conflicts from your application
* Verify your security headers (CSP/COOP) allow the SDK and iframe hosts. See [Security Headers (CSP & COOP)](/embeddable-ui/security-headers)

## Callback Issues

**Problem:** Callbacks not firing or errors when they execute.

**Solutions:**

* Ensure callbacks are properly passed to the SDK configuration
* Check that callbacks are defined before they're passed to the SDK
* Return a promise from handleReauthRequested that resolves to the new token

<Tip>
  For more targeted troubleshooting, open your browser's console to check for
  specific error messages from the SDK.
</Tip>

## Getting Help

A full example of the SDK implementation can be found [here](/samples/embed). If you continue to experience issues, contact our support team at
`support@embedreach.com` with:

* A description of the issue
* Browser and environment details
* Any relevant console errors
* Steps to reproduce the problem
