'apikey' or 'oauth2Token'.
Optionallocation: "query" | "header" | "cookie"Where the API key travels. Ignored for 'oauth2Token',
because a bearer token always travels in the Authorization header.
Optionalname: stringThe name of the header, query parameter, or cookie.
OptionalcredentialValue: stringThe API key or token value. Omit it to build the scheme alone.
A [scheme, credential] pair. The credential is undefined when
credentialValue is omitted.
// API key in a header.
const [scheme, credential] = tokenToSchemeCredential(
'apikey', 'header', 'X-API-Key', 'your_api_key_value');
Creates an AuthScheme and AuthCredential for an API key or a bearer token.