import TamboAI from "@tambo-ai/typescript-sdk"; import { QueryClient } from "@tanstack/react-query"; import React, { PropsWithChildren } from "react"; export interface TamboClientProviderProps { /** * The URL of the Tambo API (only used for local development and debugging) */ tamboUrl?: string; /** * The API key for the Tambo API. This typically comes from a variable like * `process.env.NEXT_PUBLIC_TAMBO_API_KEY` */ apiKey: string; /** * The environment to use for the Tambo API */ environment?: "production" | "staging"; /** * The user token to use to identify the user in the Tambo API. This token is * a 3rd party token like a Google or GitHub access token, exchanged with the * Tambo API to get a session token. This is used to securely identify the * user when calling the Tambo API. */ userToken?: string; /** * Additional headers to include in all requests to the Tambo API. * These will be merged with the default headers. */ additionalHeaders?: Record; /** * User key sent as a default query parameter on all API requests. * Required if no bearer token (userToken) is provided. */ userKey?: string; } export interface TamboClientContextProps { /** The TamboAI client */ client: TamboAI; /** The tambo-specific query client */ queryClient: QueryClient; /** Whether the session token is currently being updated */ isUpdatingToken: boolean; /** Additional headers to include in all requests */ additionalHeaders?: Record; /** Error from token exchange, if any */ tokenExchangeError: Error | null; /** The raw userToken value passed to the provider */ userToken: string | undefined; /** Whether the token exchange succeeded */ hasValidToken: boolean; } export declare const TamboClientContext: React.Context; /** * The TamboClientProvider is a React provider that provides a TamboAI client * and a query client to the descendants of the provider. * @param props - The props for the TamboClientProvider * @param props.children - The children to wrap * @param props.tamboUrl - The URL of the Tambo API * @param props.apiKey - The API key for the Tambo API * @param props.environment - The environment to use for the Tambo API * @param props.userToken - The oauth access token to use to identify the user in the Tambo API * @param props.additionalHeaders - Additional headers to include in all requests * @param props.userKey - User key sent as a default query parameter on all API requests * @returns The TamboClientProvider component */ export declare const TamboClientProvider: React.FC>; /** * The useTamboClient hook provides access to the TamboAI client * to the descendants of the TamboClientProvider. * @returns The TamboAI client */ export declare const useTamboClient: () => TamboAI; /** * The useTamboQueryClient hook provides access to the tambo-specific query client * to the descendants of the TamboClientProvider. * @returns The tambo-specific query client * @private */ export declare const useTamboQueryClient: () => QueryClient; /** * Hook to check if the session token is currently being updated * @returns true if the token is being refreshed, false otherwise */ export declare const useIsTamboTokenUpdating: () => boolean; //# sourceMappingURL=tambo-client-provider.d.ts.map