Required options
import { NexusAdminClient } from '@nexus/sdk-typescript';
const nexus = new NexusAdminClient({
baseUrl: 'https://nexus.microvoid.io',
managementKey: () => process.env.NEXUS_MANAGEMENT_KEY,
});baseUrl is required and trailing slashes are normalized. managementKey can be a string or a synchronous/asynchronous provider, which lets an application retrieve a rotated credential per request.
The SDK adds Authorization: Bearer <management-key> only when the request does not already contain Authorization. Keep Management Keys in the application backend; never send one to an end-user client or the Gateway.
Optional Fetch and headers
const nexus = new NexusAdminClient({
baseUrl: 'http://localhost:3000',
managementKey: process.env.NEXUS_MANAGEMENT_KEY,
fetch: instrumentedFetch,
headers: { 'user-agent': 'my-service/1.0' },
});The transport uses Web Standard Request, Response, Headers, and AbortSignal. Default headers can be overridden per request. Do not place Provider Secrets or Inference Keys in defaults.
Per-request control
Every generated method accepts AdminRequestOptions with optional headers, idempotencyKey, and signal. The SDK performs no retries automatically; retry policy remains caller-owned.