> 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/quick-start-guide.md).

# Quick Start Guide

This guide will walk you through setting up a "Hello World" integration with the Partner SDK from scratch using Vite.

#### Prerequisites

1. A **GitHub Personal Access Token (PAT)** with `read:packages` scope.
2. Partner API credentials (`client_id`, `client_secret`, and `requested_subject`) provided by the Multiplier team.

***

#### Step 1: Create a New Project

Create a new React project using Vite. When prompted, select **React** and **TypeScript + SWC**.

```bash
yarn create vite my-partner-app
cd my-partner-app
```

#### Step 2: Configure Package Registry

You must authenticate with GitHub Packages to install the SDK.

For Yarn 2+ (Berry) Create a `.yarnrc.yml` file in your project root:

```yaml
npmScopes:
  Multiplier-Core:
    npmAlwaysAuth: true
    npmAuthToken: "${GITHUB_TOKEN}"
    npmPublishRegistry: "[https://npm.pkg.github.com](https://npm.pkg.github.com)"
    npmRegistryServer: "[https://npm.pkg.github.com](https://npm.pkg.github.com)"
```

For Yarn 1.x or NPM

Create a .npmrc file in your project root:

```toml
@Multiplier-Core:registry=[https://npm.pkg.github.com](https://npm.pkg.github.com)
//[npm.pkg.github.com/:_authToken=$](https://npm.pkg.github.com/:_authToken=$){GITHUB_TOKEN}
```

#### Step 3: Install the SDK

Export your token to your environment and install the package.

```bash
export GITHUB_TOKEN=your_github_token_here
yarn add @Multiplier-Core/partner-sdk-react react@18.2.0 react-dom@18.2.0
```

#### Step 4: Configure Vite (Proxy & Polyfills)

Update your `vite.config.ts` to handle CORS proxies and polyfill `process.env`.

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

export default defineConfig({
  plugins: [react()],
  define: {
    'process.env': {} // Polyfill needed for the SDK
  },
  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)"
        }
      },
      // Add other endpoints (/api/features, /authenticate/*) similarly if needed
    }
  }
});
```

#### Step 5: Initialize the App

Replace the contents of `src/App.tsx` with the following code.

> Note: In a real application, fetch the Access Token from your backend. Do not hardcode secrets in the frontend.

```typescript
import {
  MultiplierGlobalConfigProvider,
  createGlobalConfig,
  MagicLink,
} from '@Multiplier-Core/partner-sdk-react';
import '@Multiplier-Core/partner-sdk-react/dist/index.css';

const App = () => {
  // Use the Builder pattern to create configuration
  const config = createGlobalConfig()
    .setAccessToken('your-access-token')
    .setRefreshToken('your-refresh-token')
    .setRemoteOrigin('http://localhost:5173')
    .build();

  return (
    <MultiplierGlobalConfigProvider config={config}>
       <div style={{ padding: '20px' }}>
          <h1>Partner Integration</h1>
          <MagicLink path='/company/team'>
            Go to Team Page
          </MagicLink>
       </div>
    </MultiplierGlobalConfigProvider>
  );
};

export default App;
```

#### Step 6: Run It

```bash
yarn dev
```

Open `http://localhost:5173`. You should see the button, and clicking it should authenticate and redirect you to the Multiplier Team page.


---

# 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/quick-start-guide.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.
