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

# auth0Provider

> Wire OAuth from an Auth0 tenant

`auth0Provider` wires authentication through [Auth0](https://auth0.com/). Auth0 carries the audience in the authorize request rather than as a resource indicator, so it also requires this server's public URL as `serverUrl`.

## Example

```ts server.ts highlight={1,6-10} theme={null}
import { auth0Provider, Skybridge } from "skybridge/server";

export const app = new Skybridge({
  name: "personal-shopper",
  version: "0.0.1",
  oauth: auth0Provider({
    domain: process.env.AUTH0_DOMAIN,
    audience: process.env.AUTH0_API_IDENTIFIER,
    serverUrl: process.env.SERVER_URL,
  }),
  handler,
});
```

## Signature

```ts theme={null}
auth0Provider(opts: Auth0ProviderOptions): Promise<OAuthConfig>;
```

## Parameters

### `opts`

* **`domain`** is the tenant domain, for example `acme.us.auth0.com`.

* **`audience`** is the API Identifier from the Auth0 dashboard, bound into the token's `aud` claim.

* **`serverUrl`** is this server's public URL, required for Auth0.

It also accepts the shared [`CustomProviderOptions`](https://docs.skybridge.tech/api-reference/custom-provider#parameters) options: `scopes`, `requiredScopes`, and `metadataOverrides`.

Requires Dynamic Client Registration enabled on the tenant.

## Returns

A `Promise` for the [`OAuthConfig`](https://docs.skybridge.tech/api-reference/custom-provider#returns) you pass to the [`oauth`](https://docs.skybridge.tech/api-reference/skybridge#oauth) field, as a value or from a function.

> [card] [Connect an Identity Provider](https://docs.skybridge.tech/guides/auth-providers.md)
>
> Set up sign-in with a hosted provider

> [card] [Authenticate Users](https://docs.skybridge.tech/build/auth.md)
>
> Add sign-in to your app end to end

> [card] [customProvider](https://docs.skybridge.tech/api-reference/custom-provider.md)
>
> Wire OAuth from any IdP's discovery document


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.