Skip to content

Connect project handlers

Initialize the container once at application startup and connect your own feedback and identity context. The SDK does not choose token storage, tenant-switch flow or Loading UI.

ts
import { createFastAxios } from "@fast-china/axios";

const fastAxios = createFastAxios({ baseUrl: "/api", requestCipher: false });
fastAxios.interceptors.request.use(async (config) => {
	await Promise.resolve();
	config.headers.set("Accept-Language", "zh-CN");
});
fastAxios.cache.namespace = "demo-tenant:demo-user:zh-CN";

function resetSessionCache(): void {
	fastAxios.cache.clear();
	fastAxios.cache.namespace = "";
}

Call resetSessionCache from the actual logout/session-change flow. Signatures, defaults and takeover rules are maintained in the handler API.