INNER CODE UNIT · TypeScript
createClient
nottelabs/notte · node-sdk/src/index.ts:131
export const createClient = (config?: { baseUrl?: string; token?: string }) => {
const client = createGeneratedClient({ baseUrl: config?.baseUrl || DEFAULT_API_URL });
if (config?.baseUrl) {
client.setConfig({ baseUrl: config.baseUrl });
}
if (config?.token) {
client.interceptors.request.use((request: any) => {
request.headers.set('Authorization', `Bearer ${config.token}`);
return request;
});
}
return client;
};
// Default export - NotteClient for convenience
export { NotteClient as default } from '@/client';