type alias CosmosAdapterOptions
Since 0.2.0

Options for the CosmosAdapter — the 'cosmos' arm.

A union of two arms, so supplying neither an endpoint/key pair nor a client is a compile error rather than a connect() throw. Both members stay readable on either arm, so the adapter reads options.client and options.endpoint without narrowing first. An application using Entra ID (managed identity) constructs its own client and injects it, which is why this carries no credential surface beyond the account key.

Examples

Example 1

const lazy: CosmosAdapterOptions = { endpoint, key, database: 'app' };
const injected: CosmosAdapterOptions = { client: myCosmosClient, database: 'app' };

Definition

(
CosmosAdapterOptionsBase
& { readonly endpoint: string; readonly key: string; readonly client?: ICosmosClient; }
)

| (
CosmosAdapterOptionsBase
& { readonly client: ICosmosClient; readonly endpoint?: string; readonly key?: string; }
)

Usage

import { type CosmosAdapterOptions } from "database-plugin/src/index.ts";