DocsAPI referenceAPI Reference
API reference
Every export the docs describe, read from its page: where to import it from, its signature, the fields it takes and an example. Generics carry through from your definition, so the types here are the types at the call site.
from "@noverax/courier/client"a page's or an app's calls — createCaller, createProxyCaller, createFetch, HTTPError, isHTTPError — and none of the server's partfrom "@noverax/courier/server"a server's side — createCaller, createHandler, registerSources, registerRequestContext, ensureCsrfTokenfrom "@noverax/courier"both entries' names, its createCaller the server's callerfrom "@noverax/courier/define"courier, defineApi, defineGroup, formBody, formQuery, CourierRoutes, RouteMapfrom "@noverax/courier/routes"routes — every API's routes a page may call, built from courier.config.ts by the bundler pluginfrom "@noverax/courier/config"defineConfig — the shape of courier.config.tsfrom "@noverax/courier/middleware"defineMiddleware, composeMiddlewarefrom "@noverax/courier/realtime"createMemoryPubSub, createMemoryBus, createMemoryStream, createMemoryPresence, subscribeSSE, trackedfrom "@noverax/courier/openapi"toOpenAPI — the definition as an OpenAPI documentfrom "@noverax/courier/webhooks"defineWebhook and the signature schemes — typed incoming webhooksfrom "@noverax/courier-mcp"createMcpHandler, and the courier-mcp command — the endpoints a project offers to agents, as MCP toolsfrom "@noverax/courier/testing"createTestClient, findRequests, createMockSSESubscription, createMockWSChannelfrom "@noverax/courier-react"createQueryCaller, createProxyQueryCaller, createQueryKeys, useConnectionStatusfrom "@noverax/courier-next"apiRoute(), sseRoute(), createAction()from "@noverax/courier-next/plugin"withCourier() — the routes under Turbopack and webpack, no file to generatefrom "@noverax/courier-nuxt · -hono · -express · -astro · -remix · -solid · -sveltekit"courierHandler()from "@noverax/courier-fastify · -nestjs"courierPlugin, courierMiddleware()from "@noverax/courier-build/vite"courierRoutes() — the Vite plugin that builds the routes, no file to generatefrom "@noverax/courier-build/webpack · /rspack · /rsbuild · /esbuild · /rollup · /metro · /jest"CourierRoutesPlugin, courierRoutes(), withCourier(), createTransformer() — the same routes under webpack, Rspack, Rsbuild, esbuild, Rollup, Rolldown, Metro and Jestfrom "@noverax/courier-server"createCourierServer — the standalone serverfrom "@noverax/courier-redis"createRedisPubSub, createRedisStream, createRedisPresenceCreates a data source with base URL, options, middleware, and endpoint groups.
declare function defineApi<G extends OwnGroups>(
options: BaseOptions & { groups: G }
): DefinedApi<G>BaseOptionsThe core configuration for a data source:
type BaseOptions = { baseURL?: string responseType?: "json" | "text" | "blob" | "arrayBuffer" | "formData" responseParser?: ResponseParser defaultBody?: Record<string, unknown> defaultQueryParams?: Record<string, unknown> allowedHeaders?: string[] bodySerializer?: (data: Record<string, unknown>) => BodyInit searchParamsSerializer?: SearchParamsSerializer coalesce?: boolean cancelPrevious?: boolean middleware?: Middleware[] pathOptions?: PathOptions timeout?: number headers?: HeadersInit signal?: AbortSignal session?: SessionOptions forward?: ForwardOptions }
import { defineApi } from "@noverax/courier/define"
import { users } from "./users"
import { posts } from "./posts"
const api = defineApi({
baseURL: process.env.API_URL ?? "http://localhost:4000",
groups: { users, posts },
})
export const sources = { api }
export type Sources = typeof sourcesCreates a typed endpoint group with a shared URL prefix and endpoint definitions.
declare function defineGroup<TEndpoints extends OwnEndpoints>(
config: DefineGroupConfig<TEndpoints>
): DefinedGroup<TEndpoints>
declare function defineGroup<TGroups extends OwnGroups, TEndpoints extends OwnEndpoints>(
config: DefineNestingGroupConfig<TEndpoints, TGroups>
): DefinedNestingGroup<TEndpoints, TGroups>DefineGroupConfigtype DefineGroupConfig<E> = GroupOptions & { endpoints: E } type DefineNestingGroupConfig<E, G> = GroupOptions & { endpoints?: E groups: G } type GroupOptions = { prefix?: string pathOptions?: (request?: Request) => Record<string, unknown> | Promise<Record<string, unknown>> expose?: boolean cancelPrevious?: boolean fetch?: SourceFetch webSocket?: SourceWebSocket dispatcher?: SourceDispatcher proxy?: string // Bun tls?: object // Bun client?: object // Deno }prefix— URL path segment prepended to all endpoint URLs in this group.pathOptions— async function that returns dynamic key-value pairs (headers, cookies) to inject per request.expose— whether the browser may call the group through the proxy; it overrides the source's, and a group inside another overrides its outer group's.cancelPrevious— whether a newer call of one of the group's reads cancels the older call of that read still in flight. It overrides the client's and the source's, a group inside another overrides its outer group's, and an endpoint's.cancelPrevious()and a call's.with()override it. A value other thantrueorfalsethrowsConfigurationError("CANCEL_PREVIOUS_INVALID"). See Deduplication & Abort.groups— groups inside this one, created withdefineGroup, to any depth: see Groups inside groups. A group made only of groups needs noendpoints.endpoints— record of typed endpoint functions, under any name but the reserved ones, which hold for the endpoints and groups given todefineApias well.
import { courier, defineGroup } from "@noverax/courier/define"
const { endpoint } = courier()
type User = { id: string; name: string; email: string }
export const users = defineGroup({
prefix: "users",
endpoints: {
getAll: endpoint.get("").response<User[]>(),
getById: endpoint.get(":id").variables<{ id: string }>().response<User>(),
create: endpoint.post("").variables<{ name: string; email: string }>().response<User>(),
update: endpoint.put(":id").variables<{ id: string; name: string }>().response<User>(),
remove: endpoint.del(":id").variables<{ id: string }>().response<null>(),
},
})Build a named middleware that runs before a call, after it, or around it, for a whole source, a base or one endpoint.
import type { AfterHandler, BeforeHandler, Middleware, WrapHandler } from "@noverax/courier/middleware"
declare function defineMiddleware(name: string, phase: "before", handler: BeforeHandler): Middleware
declare function defineMiddleware(name: string, phase: "after", handler: AfterHandler): Middleware
declare function defineMiddleware(name: string, phase: "wrap", handler: WrapHandler): MiddlewarenameA string: what Studio calls the middleware. Its Middleware view, each request's pipeline and its timings show it under this name.
phaseWhen the handler runs, and so what it is handed.
type MiddlewarePhase = "before" | "after" | "wrap"before— changes the request — its headers, its variables — and lets it go on; it never sees the answerafter— receives the answer and returns it, changed or notwrap— callsnext()once, more than once or not at all, and returns an answer; for timing, retries, short-circuiting and error handling
handlerThe function for that phase, handed the call's context:
type BeforeHandler = (ctx: MiddlewareContext) => void | Promise<void> type AfterHandler = ( ctx: MiddlewareContext, response: MiddlewareResponse, ) => MiddlewareResponse | Promise<MiddlewareResponse> type WrapHandler = ( ctx: MiddlewareContext, next: () => Promise<MiddlewareResponse>, ) => Promise<MiddlewareResponse>ctx.variables— the call's variables, which abeforeorwraphandler may replacectx.headers— the request's headers, to read or setctx.transport—"http"for a request,"sse"or"ws"for a stream or a channelctx.kind— whether the endpoint reads or writesctx.signal— fires when the caller stops waitingctx.request— the incoming request, when a proxy runs the callresponse—{ status, data, headers }: the answer anafterhandler receives andnext()resolves to
import { defineMiddleware } from "@noverax/courier/middleware"
export const timing = defineMiddleware("timing", "wrap", async (ctx, next) => {
const start = performance.now()
const response = await next()
const ms = Math.round(performance.now() - start)
console.log(`${ctx.source}.${ctx.group}.${ctx.method} → ${response.status} in ${ms} ms`)
return response
})Factory function that creates a typed caller for server-side direct HTTP calls — no proxy hop needed.
import type { CallerDefaults, TypedClient } from "@noverax/courier/client"
import type { DefinedApi } from "@noverax/courier/define"
declare function createCaller<TApi extends DefinedApi>(
api: TApi,
defaults?: CallerDefaults,
): TypedClient<TApi>apiAn API source definition created with
defineApi().import { api } from "@/api" const caller = createCaller(api)CallerDefaultsOptional default settings applied to every request.
type CallerDefaults = { timeout?: number cancelPrevious?: boolean headers?: Record<string, string> context?: Context onError?: (error: RequestFailure) => void | Promise<void> onSuccess?: (data: unknown) => void | Promise<void> ws?: CallerWSOptions } type CallerWSOptions = { auth?: WSAuthParams | (() => WSAuthParams | undefined | Promise<WSAuthParams | undefined>) backoff?: { initialMs?: number; maxMs?: number; factor?: number; jitter?: boolean } fallback?: false | { after?: number; remember?: boolean } messageQueue?: { maxCount?: number; maxBytes?: number; overflow?: "reject" | "drop-oldest" } protocols?: string[] reconnectOnResume?: boolean } type WSAuthParams = Record<string, unknown>ws— options of the sockets this caller's channels and push subscriptions open; see Connection options.
import { createCaller } from "@noverax/courier/server"
import { api } from "@/api"
export const caller = createCaller(api, {
timeout: 10000,
})
// Usage: caller.group.method(variables?)
const result = await caller.users.getAll()
const user = await caller.users.getById({ id: "123" })Factory function that creates a typed client with dot-notation access for proxy-mode HTTP calls from the browser.
import type { InferClient, ProxyCallerOptions } from "@noverax/courier/client"
import type { CourierRoutes, RoutedApi, RouteShape } from "@noverax/courier/define"
declare function createProxyCaller<TApi, TEndpoints extends Readonly<Record<string, RouteShape>>>(
routes: CourierRoutes<TApi, TEndpoints>,
options?: ProxyCallerOptions,
): InferClient<RoutedApi<TApi, TEndpoints>>routesThe routes of one API —
routes.apifrom@noverax/courier/routesfor the source registered asapi, orapiRoutesfromcourier.routes.ts. See Exposing Endpoints for how Courier gives them, and how to write them by hand in a project without acourier.config.ts. Routes whosecancelPreviousis neithertruenorfalseare refused withConfigurationError("CANCEL_PREVIOUS_INVALID")when the client is made; the plugin, orcourier-cli routes, gives them again.interface CourierRoutes<TApi, TEndpoints> { source: string // the name the server registered the API under endpoints: TEndpoints // each endpoint a page may call, by its path, and how it is reached cancelPrevious?: boolean // the API's own cancelPrevious coalesce?: boolean // the API's own coalesce } type RouteShape = | { type: "query"; get?: true; cancelPrevious?: boolean } // a read; GET when it may be cached; its endpoint's or groups' cancelPrevious | { type: "mutation" } // a write | { transport: "sse" } // a server-sent event stream | { transport: "ws"; bidirectional?: true } // a socket; one the caller also sends onProxyCallerOptionsAll fields are optional.
type ProxyPath = { http?: string // default: "/api/request" sse?: string // default: "/api/sse" ws?: string // no default — required for WS endpoints } type ProxyCallerOptions = { proxyPath?: ProxyPath timeout?: number cancelPrevious?: boolean coalesce?: boolean credentials?: RequestCredentials headers?: Record<string, string> onError?: (error: RequestFailure) => void | Promise<void> onSuccess?: (data: unknown) => void | Promise<void> ws?: CallerWSOptions } type CallerWSOptions = { auth?: WSAuthParams | (() => WSAuthParams | undefined | Promise<WSAuthParams | undefined>) backoff?: { initialMs?: number; maxMs?: number; factor?: number; jitter?: boolean } fallback?: false | { after?: number; remember?: boolean } messageQueue?: { maxCount?: number; maxBytes?: number; overflow?: "reject" | "drop-oldest" } protocols?: string[] reconnectOnResume?: boolean } type WSAuthParams = Record<string, unknown>proxyPath— where the app serves its proxy routes, per transport. Each field accepts either a relative path, resolved against the page's origin, or an absolute URL; a missing one falls back to the built-in default. The routes do not say it: it depends on where the page is served.cancelPrevious— whether a newer call of one of the client's reads cancels its call still in flight to the same endpoint; the cancelled call rejects with anAbortErrorof code"SUPERSEDED". An endpoint's.cancelPrevious()and its groups' own, which the routes carry, and a call's.with({ cancelPrevious })decide over it. Defaults to the API's own, which the routes carry too. Only a read the routes name is ever cancelled, and only in a browser or a React Native app — see Deduplication & Abort.coalesce— whether identical reads in flight together reach the proxy once, each call with a copy of the answer. On by default;falsesends every call alone. Defaults to the API's own, which the routes carry.timeout— how long the browser waits for the proxy, in milliseconds. It is not sent to the server, so the endpoint's own.timeout()still bounds the upstream call; a timeout given with.with()for one call is sent.credentials— whether the browser sends its cookies to the proxy route, with every call and stream. Defaults to"include". The proxy forwards them to the backend only where the source or the endpoint namescookie— see Cookies.headers— default headers merged into every request and stream, and sent in the first frame of every socket its channels open, which the proxy reads as the socket's own — a browser cannot put them on a WebSocket's handshake.onError— global error handler invoked on everyHTTPError.onSuccess— global success handler invoked on every successful response.ws— options of the sockets this caller's channels and push subscriptions open; see Connection options.
import { createProxyCaller } from "@noverax/courier/client"
import { routes } from "@noverax/courier/routes"
const caller = createProxyCaller(routes.api, {
timeout: 10000,
credentials: "include",
})
// Dot-notation: caller.group.method(variables)
const users = await caller.users.getAll()
const user = await caller.users.getById({ id: "123" })Creates a direct-mode React Query client that connects straight to the backend, no proxy adapter required.
declare function createQueryCaller<TApi extends DefinedApi>(
api: TApi,
defaults?: QueryCallerDefaults,
): QueryCallerClient<TApi>Creates a proxy-mode React Query client with dot-notation hooks for every endpoint group, routed through the server adapter.
import type { ProxyCallerOptions } from "@noverax/courier/client"
import type { CourierRoutes, DefinedApi, RoutedApi, RouteShape } from "@noverax/courier/define"
import type { QueryCallerClient } from "@noverax/courier-react"
declare function createProxyQueryCaller<
TApi extends DefinedApi,
TEndpoints extends Readonly<Record<string, RouteShape>>,
>(
routes: CourierRoutes<TApi, TEndpoints>,
options?: ProxyCallerOptions,
): QueryCallerClient<RoutedApi<TApi, TEndpoints>>Build the React Query keys the hooks use, typed by your API, for invalidation, prefetching and optimistic updates.
import type { CourierRoutes, DefinedApi, RoutedApi, RouteShape } from "@noverax/courier/define"
import type { QueryKeyFactory } from "@noverax/courier-react"
declare function createQueryKeys<TApi extends DefinedApi>(api: TApi): QueryKeyFactory<TApi>
declare function createProxyQueryKeys<
TApi extends DefinedApi,
TEndpoints extends Readonly<Record<string, RouteShape>>,
>(routes: CourierRoutes<TApi, TEndpoints>): QueryKeyFactory<RoutedApi<TApi, TEndpoints>>An in-memory client for tests: typed like your API, answered by mocks, recording every call — no HTTP.
import type { DefinedApi } from "@noverax/courier/define"
import type { TestClient } from "@noverax/courier/testing"
declare function createTestClient<TApi extends DefinedApi = DefinedApi>(): TestClient<TApi>clienta typed client, with the same dot-notation,
.rawand.with()ascreateCaller; streams and channels answer as their mocks saymockmock(group, method), checked against the API, returns a builder typed by the endpoint's response and variables:resolves,returns,rejects,stream,channel,once,times,delayhistoryevery call, in order, with its
group,method,variables,resultorerror, and whether it was a stream or a channelresetclears the mocks and the history
resetMocksclears the mocks only
resetHistoryclears the history only
import { beforeEach, expect, it } from "vitest"
import { createTestClient } from "@noverax/courier/testing"
import type { api } from "../lib/api"
const { client, mock, history, reset } = createTestClient<typeof api>()
beforeEach(() => reset())
it("lists the users", async () => {
mock("users", "getAll").resolves([{ id: 1, name: "Ada" }])
const users = await client.users.getAll()
expect(users).toEqual([{ id: 1, name: "Ada" }])
expect(history[0]?.method).toBe("getAll")
})Universal adapter factory that creates Web Standard handlers for proxy-mode requests from any framework.
declare function createHandler(config?: HandlerConfig): AdapterHandlerconfig.sourcesA record of API source definitions created with
defineApi(). Given, the handler answers for those sources alone, and a laterregisterSources()in the same process does not change what it serves. Left out, the handler reads the process-wide registry thatregisterSources()andattachRuntime()fill, at request time — which is how every framework adapter works.Other options| Option | Default | Description | |--------|---------|-------------| |
allowedOrigins| own origin; local ports in development, for an app served locally | Origins of other pages that may call the proxy — see Origin Validation | |allowedHosts| loopback names and IP literals; every name in production | Host names the app is reached by; a request for any other gets421— see Host validation | |maxBodyBytes| 1 MB | Largest JSON envelope the handler reads; a larger one is refused with 413 | |maxUploadBytes| 10 MB | Largestmultipart/form-dataupload the handler reads; a larger one is refused with 413 | |uploadMode|"auto"| Where an upload is kept while the call runs: memory up touploadMemoryBytes, then disk where there is one;"memory"never writes one to disk;"stream"keeps none of it and sends it on as it arrives — see where the proxy keeps an upload | |uploadMemoryBytes| 1 MB | How much of one upload's files stays in memory before the rest goes to disk | |totalUploadMemoryBytes| 64 MB | How much every upload together keeps in memory at once, files and text fields: past it a file goes to disk, or an upload that must stay in memory is refused | |totalUploadDiskBytes| 1 GB | How much every upload together keeps on disk at once: past it an upload is refused | |uploadDirectory|os.tmpdir()| Where each upload's own folder is made, removed once its call is done | |maxUploadParts| 1000 | Most parts one upload may hold: its fields and files, and the call's options the client writes first | |bodyIdleTimeoutMs| 30 seconds | Longest pause between two pieces of a request body | |bodyTimeoutMs| 5 minutes | Longest a request body may take to arrive | |sseHeaders| — | Extra response headers on every SSE stream | |sseMaxLifetimeMs| 30 minutes | Longest an SSE stream stays open before the client reconnects withLast-Event-ID| |maxSSEConnections| unlimited | Most SSE streams open at once, each counted from its request on, while its middleware andonSSEConnectrun; one more is answered 503 | |onSSEConnect,onSSEDisconnect,onSSEError| — | SSE lifecycle hooks |Request bodiesThe handler reads a body as it arrives and refuses it, with the status and
codebelow, as soon as it can tell; what the client still sends is taken off the connection, so a browser reads the answer once its upload is done.
Internal HTTP client that wraps native fetch with typed methods, automatic serialization, and path parameter resolution.
get: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
post: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
put: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
patch: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
del: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
head: <T>(url?, options?) => Promise<HttpResponse<T>>
options: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>
query: <T>(url?, variables?, options?) => Promise<HttpResponse<T>>Custom error class for HTTP responses with typed data, status code, and headers. Includes the isHTTPError type guard.
import { CourierError, type HttpResponse } from "@noverax/courier/client"
declare class HTTPError<TData = unknown> extends CourierError<"HTTP_ERROR"> {
readonly status: number
readonly headers: Headers
readonly data: TData
constructor(response: HttpResponse<TData>, options?: { cause?: unknown; message?: string })
}statusthe answer's HTTP status code, from 100 to 599. An
HTTPErroralways holds an answer: a request that got none is aNetworkError, one whose time ran out aTimeoutError, andnew HTTPError()refuses any other status with aRangeError.headersthe answer's
Headersobject.datathe parsed response body. Typed as
TData(defaults tounknown).namealways
"HTTPError";code— always"HTTP_ERROR".message"HTTP {status}"(e.g.,"HTTP 404").
import { isHTTPError } from "@noverax/courier/client"
try {
const user = await caller.users.getById({ id: "999" })
} catch (error) {
if (isHTTPError(error)) {
console.error(`HTTP ${error.status}:`, error.data)
}
}The errors a call rejects with when no answer came, its time ran out, or it was cancelled — with the platform's code, the scope of the time, the reason given, and the guards that tell them apart.
import { CourierError } from "@noverax/courier/client"
declare class NetworkError extends CourierError<"NETWORK_ERROR"> {
readonly systemCode: string | undefined // "ECONNREFUSED", "ENOTFOUND", "UND_ERR_SOCKET", "CERT_HAS_EXPIRED", …
}Cut every credential out of a text, headers, an error or data before it is logged or sent elsewhere — the rules Courier's own log and Studio use.
declare function redact(value: string): string
declare function redact(value: Headers): Record<string, string | string[]>
declare function redact(value: Error): Error
declare function redact(value: unknown): unknownThe options one call takes with .with(): its timeout, headers and signal, upload and download progress, a stream instead of parsed data, and the verb sent to the proxy.
type CallOptions = Omit<RequestInit, "method" | "body" | "signal"> & {
signal?: AbortSignal | null
timeout?: number
stream?: boolean
forwardVariables?: boolean
method?: "GET" | "POST"
responseType?: "json" | "text" | "blob" | "arrayBuffer" | "formData"
onUploadProgress?: (progress: UploadProgress) => void
onDownloadProgress?: (progress: DownloadProgress) => void
coalesce?: boolean
cancelPrevious?: boolean
rawData?: boolean
}
type WithOptions = Omit<CallOptions, "rawData">signalaborts the call when it fires
timeoutmilliseconds each request the call sends may take, from the moment it is sent, so each attempt of a retried call has its own; a call's own wins over the source's
headersadded to the call's headers, name by name, whatever their case;
.with()at the client, a group and an endpoint merges them allstreamanswers with the response's body as a stream, unread, instead of the parsed data, where the
fetchhands one over as it comes: React Native's own does not, and a call that asks for one there is refused with aConfigurationErrorRESPONSE_STREAM_UNAVAILABLEforwardVariableswhether the HTTP methods an endpoint calls send the call's variables by themselves, as the body of a write or the query of a read;
falseleaves them to the endpoint's own.via()code. Defaults totruemethodthe verb the call goes to the proxy with: GET for a read that may be cached — one that declares
.cache()and whose variables are not sensitive — and POST for every other call by default;"POST"keeps a read's variables out of the addressresponseTypehow a successful answer is read, when not as the source reads every answer
onUploadProgresscalled as the body is sent, with
percentfrom 0 to 1,transferredBytesandtotalBytes; a callback that throws fails the call with what it threw, which no retry sends again, and so does one given toonDownloadProgressonDownloadProgresscalled as the answer comes in, in the same terms: as it is read, or as
XMLHttpRequesttakes it in for a call sent through it — one that does not read its answer as a stream: an upload that reports its progress, and in React Native a download that reports its own, unless the API sends its calls with afetchof its owncoalescefalsesends the call alone, never joining an identical read already in flight; see Deduplication & AbortcancelPreviouswhether this call cancels the older call of its read still in flight, and may be cancelled by a newer one, over what the endpoint, its groups, the client and the API say.
.with()given to a whole client still decides call by call. A write is never cancelled, and a value other thantrueorfalsemakes the call reject withConfigurationError("CANCEL_PREVIOUS_INVALID"); see Deduplication & AbortRequestInitthe rest of
fetch's own options,cache,credentials,keepalive,mode,priority,redirect,referrer,referrerPolicyandintegrity, passed to it as they are
import { caller } from "@/lib/caller"
const controller = new AbortController()
// A slow endpoint gets more time, and the user can cancel it
const report = await caller.reports
.with({ timeout: 30_000, signal: controller.signal })
.generate({ type: "annual" })
// An upload reports how far it got, from 0 to 1
await caller.files
.with({ onUploadProgress: ({ percent }) => console.log(`${Math.round(percent * 100)}%`) })
.upload({ body: blob })Complete reference for all TypeScript types exported by @noverax/courier.
type TypedClient<T extends DefinedApi<any>, Raw extends boolean = false> = {
[K in keyof ApiGroups<T>]: GroupClient<ApiGroups<T>[K], Raw>
} & {
raw: TypedClient<T, true>
with(options: WithOptions): TypedClient<T, Raw>
}Every field of courier.config.ts: the sources, the API imports Studio keeps in sync, Studio, the standalone server, the runtime and what agents may call.
import { defineConfig } from "@noverax/courier/config"
import { api } from "./api/sources"
export default defineConfig({
sources: { api },
studio: { port: 6280 },
server: { allowedOrigins: ["https://app.example.com"] },
runtime: { appOrigin: "http://localhost:3000" },
})Endpoint builder
Starters returning a chainable descriptor. .variables() and .response() carry the types to every call site; .via(probe) works the address out from the variables.