> For the complete documentation index, see [llms.txt](https://developer.usemultiplier.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.usemultiplier.com/multiplier-embed-sdks/troubleshooting.md).

# Troubleshooting

This guide covers common issues developers face when integrating the Partner SDK and how to resolve them.

***

### Common Issues

#### 1. "Process is not defined" Error

**Symptom:** You see the following error in your browser console:

> `Uncaught ReferenceError: process is not defined`

**Cause:** The SDK relies on `process.env` internally. However, modern bundlers like **Vite** or **Webpack 5** do not include Node.js globals (like `process`) in the browser environment by default.

**Solution (Vite):** Add the `define` property to your `vite.config.ts` to manually polyfill it:

```typescript
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  plugins: [react()],
  define: {
    // This polyfills process.env for the SDK
    'process.env': {} 
  }
});
```

Solution (Webpack 5 / Next.js): You may need to configure the `ProvidePlugin` or update your Webpack config to handle Node polyfills.

***

#### 2. CORS Errors or 404s on API Calls

Symptom: Network requests to `/graphql` or `/authenticate` fail with status `404 Not Found` or a CORS (Cross-Origin Resource Sharing) error.

Cause: Browsers block requests made from your local development server (e.g., `http://localhost:5173`) to the Multiplier API (`https://api.usemultiplier.com`) for security reasons. Additionally, the SDK makes relative requests that need to be proxied.

Solution: Configure a proxy in your local development server.

Vite Proxy Example: Update `vite.config.ts` to forward requests:

```typescript
server: {
  proxy: {
    "/graphql": {
      target: "[https://api.usemultiplier.com](https://api.usemultiplier.com)",
      secure: true,
      changeOrigin: true,
      headers: {
        'Origin': "[https://app.usemultiplier.com](https://app.usemultiplier.com)"
      }
    },
    "/authenticate": {
      target: "[https://api.usemultiplier.com](https://api.usemultiplier.com)",
      secure: true,
      changeOrigin: true,
      headers: {
        'Origin': "[https://app.usemultiplier.com](https://app.usemultiplier.com)"
      }
    },
    "/api": {
        target: "[https://api.usemultiplier.com](https://api.usemultiplier.com)",
        secure: true,
        changeOrigin: true,
        headers: {
          'Origin': "[https://app.usemultiplier.com](https://app.usemultiplier.com)"
        }
    }
  }
}
```

***

#### 3. Authentication Failures (401 Unauthorized)

Symptom: The SDK fails to load data, and the console shows 401 errors.

Checklist:

1. Valid Token: Ensure the `accessToken` you passed to `createGlobalConfig()` is valid and not expired.
2. Refresh Logic: Verify that you have implemented the `onTokenRefreshed` callback to save the new token when the SDK automatically refreshes it.
3. Environment: Ensure you are using the correct credentials (`client_id`, `client_secret`) for the environment (Sandbox vs. Production).

***

#### 4. Style Issues (Components look broken)

Symptom: Components appear without styling or look "plain."

Cause: The CSS file was not imported.

Solution: Ensure you have imported the CSS file at the root of your application (e.g., `App.tsx` or `main.tsx`):

```typescript
import '@Multiplier-Core/partner-sdk-react/dist/index.css';
```

***

### Support

If you encounter an issue not listed here, please reach out to the Multiplier Core Team with the following details:

1. A screenshot of the error.
2. The code snippet showing your `MultiplierGlobalConfigProvider` setup.
3. Network logs (HAR file) if relevant.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.usemultiplier.com/multiplier-embed-sdks/troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
