# toPublicOAuth2Scheme

**Kind:** Function

**Source:** [`atloria-monorepo/apps/api/src/project/playground-oauth2.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/project/playground-oauth2.ts#L45)

A scheme safe to publish, or null.

Every URL must be https: the spec is served to anonymous readers over the public internet,
and a plain-http authorization endpoint would put an authorization code — and then a token —
on the wire in clear. (The browser client makes the same check again; this one keeps the
broken configuration out of the published document in the first place.)

## Signature

```ts
function toPublicOAuth2Scheme(config: PlaygroundOAuth2Config | null | undefined): { id: string; scheme: Record<string, unknown> } | null
```

## Parameters

| Name | Type |
|---|---|
| `config` | `PlaygroundOAuth2Config | null | undefined` |

**Returns:** `{ id: string; scheme: Record<string, unknown> } | null`
