> 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/components/magic-link.md).

# Magic Link

The `MagicLink` component simplifies the process of redirecting a user from your platform to the Multiplier platform. It handles the authentication "handshake" automatically—fetching an auth code using your tokens and constructing the secure, authenticated URL for the user.

### Basic Usage

The simplest way to use the component is to render it as a button. It will automatically handle the click, authentication, and redirection.

```tsx
import { MagicLink } from '@Multiplier-Core/partner-sdk-react';

<MagicLink path="/company/team">
  Go to Team Page
</MagicLink>
```

### Advanced Usage (Render Props)

If you need full control over the UI (e.g., using your own Button component or showing a loading spinner), use the Render Props pattern.

The child function receives:

* `loading`: Boolean indicating if the auth code is currently being fetched.
* `handleClick`: Function to trigger the navigation.

```typescript
import { MagicLink } from '@Multiplier-Core/partner-sdk-react';

<MagicLink path="/company/team">
  {({ loading, handleClick }) => (
    <button
      onClick={handleClick}
      disabled={loading}
      className="my-custom-btn"
    >
      {loading ? 'Redirecting...' : 'Open Multiplier'}
    </button>
  )}
</MagicLink>
```

### Props

| **Prop**    | **Type**                     | **Description**                                                                    |
| ----------- | ---------------------------- | ---------------------------------------------------------------------------------- |
| `path`      | `string`                     | Required. The destination path on the Multiplier platform (e.g., `/company/team`). |
| `params`    | `Record<string, string>`     | Key-value pairs to replace dynamic parameters in the path (e.g., `{ id: '123' }`). |
| `search`    | `Record<string, string>`     | Key-value pairs to append as query strings `?key=value`.                           |
| `className` | `string`                     | CSS class for the default button wrapper (ignored if using render props).          |
| `onClick`   | `(finalUrl: string) => void` | Callback fired *after* the link is generated and opened.                           |

```
```


---

# 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/components/magic-link.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.
