> ## 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.

# clerkProvider

> Wire OAuth from a Clerk instance

`clerkProvider` wires authentication through [Clerk](https://clerk.com/). Clerk access tokens carry no `aud` claim, so there is no `audience` option.

## Example

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

export const app = new Skybridge({
  name: "personal-shopper",
  version: "0.0.1",
  oauth: clerkProvider({
    domain: process.env.CLERK_FRONTEND_API,
  }),
  handler,
});
```

## Signature

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

## Parameters

### `opts`

**`domain`** is the Clerk Frontend API URL, for example `acme.clerk.accounts.dev` or a production custom domain.

There is no `audience` option: Clerk binds no audience to its tokens.

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

Requires Dynamic Client Registration enabled on the instance, and the OAuth application set to issue JWT access tokens (opaque tokens can't be verified).

## 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.