Skip to main content

retrieveConfig

Retrieve

Returns a configuration by name. This request needs no user_token, so a browser integration can read its own configuration at runtime.

Endpoint​

GET /keys/{key}/configs/{config}

See the API reference for this endpoint.

Import​

import { retrieveConfig } from "@addresszen/sdk";

Path Parameters​

NameTypeRequiredDescription
keystringyesAPI Key The API Key to retrieve. Begins ak_.
configstringyesConfiguration Name User-provided configuration object name.

Query Parameters​

None.

Response Type​

import type { RetrieveConfigResponse } from "@addresszen/sdk";

Errors​

HTTP errors throw an ApiError with the HTTP status and the API error code and message. Network failures and aborts reject with the runtime's native error. Pass throwOnError: false to get { data, error } instead. See error handling.

Example​

retrieve-config.tsts
import { createZenClient, retrieveConfig } from "@addresszen/sdk";

export const example = async () => {
const client = createZenClient({ apiKey: "ak_test" });
const { data } = await retrieveConfig({
client,
path: { key: "ak_test", config: "checkout" },
});
return data;
};