interface ApiKeyOptions
Since 0.1.0

API key configuration options.

Properties

readonly
optional
header: string

Header name for API key (default: 'X-API-Key').

readonly
validate: (key: string) => Promise<IPrincipal | null>

Callback to validate the API key and return a principal. Return null if the key is invalid.

Usage

import { type ApiKeyOptions } from "auth-plugin/src/index.ts";