Skip to content

remoteSource

remoteSource(options): ConfigSource

Defined in: sources.ts:113

A source that fetches a JSON object of config values from an HTTP endpoint.

The endpoint must return a flat Record<string, string>. Nested objects and arrays are not supported - flatten on the server before sending, or use a more capable secret manager and write a custom source.

Failures are soft: a network error returns an empty object so the loader can fall back to other sources. Validate via the schema if a remote value is required.

RemoteSourceOptions

ConfigSource

remoteSource({
url: "https://config.internal/app",
headers: { authorization: `Bearer ${token}` },
})