> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/chord-oms/developer-tools/authentication.md).

# Authentication

## Auth Providers

We currently support two auth providers: [Magic](https://magic.link/) and [Stytch](https://stytch.com/).

Note: We do also support Cognito, but you will need to contact your account rep or sales rep for more information.

## ChordProvider

In order to use our auth providers, you will first need to wrap your app in `ChordProvider` and pass it an auth client.

{% tabs %}
{% tab title="Stytch" %}

```javascript
import { ChordProvider } from '@chordcommerce/react-autonomy'
import { StytchClient } from '@chordcommerce/chord-stytch'

const MyApp = ({ Component, pageProps }) => {
    const stytchClient = new StytchClient({
        apiKey: process.env.NEXT_PUBLIC_STYTCH_API_KEY,
        redirectPath: '/authenticate',
        sessionDurationMinutes: 60
    })

    return (
        <ChordProvider auth={stytchClient}>
            <Component pageProps={...pageProps} />
        </ChordProvider>
    )
}
```

{% endtab %}

{% tab title="Magic" %}

```javascript
import { ChordProvider } from '@chordcommerce/react-autonomy'
import { MagicClient } from '@chordcommerce/chord-magic'

const MyApp = ({ Component, pageProps }) => {
    const magicClient = new MagicClient(process.env.MAGIC_API_KEY)

    return (
        <ChordProvider auth={magicClient}>
            <Component pageProps={...pageProps} />
        </ChordProvider>
    )
}
```

{% endtab %}
{% endtabs %}

## Migration Guides

For more on how to add auth to your site see the [Next.js ↔️ Stytch Migration Guide](/chord-oms/developer-tools/authentication/stytch/stytch-migration-guides/next-js-stytch-migration-guide.md) or [Magic Migration Guide](/chord-oms/developer-tools/authentication/magic/magic-migration-guide.md) documentation


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/chord-oms/developer-tools/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
