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

# workosProvider

> Wire OAuth from WorkOS AuthKit

`workosProvider` wires authentication through [WorkOS AuthKit](https://www.workos.com/), so your tools receive a signed-in WorkOS user.

## Example

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

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

## Signature

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

## Parameters

### `opts`

* **`domain`** is the AuthKit domain, for example `acme.authkit.app`.

* **`audience`** is the [Resource Indicator](https://datatracker.ietf.org/doc/html/rfc8707) configured in the WorkOS dashboard, typically this server's public URL. AuthKit binds it into the token's `aud` claim. Reached at more than one URL, say a local port and a `skybridge dev --tunnel` URL? Register each one as a Resource Indicator and pass them all as an array.

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 in the WorkOS dashboard (Connect → Configuration).

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