BEARER_AUTH_SCHEME (lib/openapi-auth.ts)

saasmail · worker/src/lib/openapi-auth.ts · typescript · Apache-2.0
auth, Auth / Identity

Shared OpenAPI bearer auth scheme constants for API docs and routes.

// Source: https://github.com/choyiny/saasmail | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/** Shared OpenAPI auth documentation for `/doc` and route-level `security`. */

export const BEARER_AUTH_SCHEME = "BearerAuth";

export const openapiInfoDescription = `Self-hosted email API for a single saasmail Worker deployment.

## Authentication

Most routes require authentication via one of:

- **API key (recommended for integrations):** \`Authorization: Bearer sk_…\`
  Keys are issued per user at \`POST /api/api-keys\` (shown once at creation).
- **Session cookie:** BetterAuth session from the web UI (used by the SPA).

Unauthenticated requests to protected routes receive \`401 Un

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key