Skip to content

AquienpzClientOptions

type AquienpzClientOptions = {
apiKey?: string;
cdnBase?: string;
endpoint: string;
headers?: Record<string, string>;
signingKey?: string;
tenantCode: string;
tenantId: number;
};

Defined in: packages/sdk/src/index.ts:78

Permissive constructor options for the root AquienpzClient.

App code should NOT import this type directly — prefer the strict variants from the subpaths:

  • WebClientOptions from @aquienpz/sdk/web (no apiKey)
  • ServerClientOptions from @aquienpz/sdk/server (apiKey required)

This root type is the union both modes resolve to; the underlying class accepts both shapes so subpath wrappers can extend without duplication.

optional apiKey?: string;

Defined in: packages/sdk/src/index.ts:93

Better Auth API key with the amk_rt_* prefix.

Server-only. Omit when constructing from @aquienpz/sdk/web — your BFF / route handler injects the bearer header in proxy mode.


optional cdnBase?: string;

Defined in: packages/sdk/src/index.ts:108

Override the public CDN base. Defaults to https://8ok.uk.


endpoint: string;

Defined in: packages/sdk/src/index.ts:86

Base URL of the aquienpz asset-manager (Cloud Run service URL).

May be relative (e.g. /api/am) ONLY in browser contexts where the SDK resolves it against window.location.origin. Node/Bun consumers must always pass an absolute URL.


optional headers?: Record<string, string>;

Defined in: packages/sdk/src/index.ts:102

Extra headers merged into every request. The documented way for mobile/Expo clients to authenticate a BFF that gates on the Better Auth session: they can’t send cookies automatically, so they pass { Cookie: authClient.getCookie() } here (see Better Auth Expo docs, “Making Authenticated Requests to Your Server”). Web/server consumers omit this — browsers attach the same-origin cookie and servers pass apiKey.


optional signingKey?: string;

Defined in: packages/sdk/src/index.ts:118

Tenant’s HMAC signing key for transform URLs (Phase 3). Required only when calling aq.transform(asset, opts, { sign: true }).

Generated server-side per tenant (see infra/sql/tenants_signed_transforms.sql); fetch via GET /admin/tenants/:id with an admin key. Keep it server-side only — do not ship in NEXT_PUBLIC_* env vars. Sign URLs from a BFF route handler, or pre-sign at build time.


tenantCode: string;

Defined in: packages/sdk/src/index.ts:104

Tenant code — sent as X-Tenant-Code (log-only). Authoritative scope is the key’s metadata.tenantId.


tenantId: number;

Defined in: packages/sdk/src/index.ts:106

Numeric tenant id — used to build tenant-prefixed CDN URLs <cdn>/<tenantId b36>/v/<sha>-<preset>.<ext>.