UNPKG

@revrag-ai/embed-react-native

Version:

A powerful React Native library for integrating AI-powered voice agents into mobile applications. Features real-time voice communication, intelligent speech processing, customizable UI components, and comprehensive event handling for building conversation

54 lines 1.83 kB
import type { ApiResponse, TokenDetails, UpdateDataRequest } from './types/embed.api.types'; /** * APIService class that ensures proper initialization before API calls */ export declare class APIService { private static instance; private apiBaseUrl; private isInitialized; private constructor(); /** * Get singleton instance of APIService */ static getInstance(): APIService; /** * Initialize the API service with the base URL */ initialize(): Promise<void>; /** * Ensure the service is initialized before making API calls */ private ensureInitialized; /** * Get headers with stored API key */ private getHeaders; /** * Register a new user/device on initialization * @returns Promise with registration response */ registerOnInitialize(): Promise<ApiResponse<TokenDetails>>; /** * Update user data * @param params Update parameters including userId and data to update * @returns Promise with update response */ updateUserData(params: UpdateDataRequest): Promise<ApiResponse<void>>; /** * Get token details for a user * @param params Parameters including app_user_id and call_type * @returns Promise with token details */ getTokenDetails(params: { app_user_id: string; call_type: string; }): Promise<ApiResponse<TokenDetails>>; } export declare const initializeApi: () => Promise<void>; export declare const registerOnInitialize: () => Promise<ApiResponse<TokenDetails>>; export declare const updateUserData: (params: UpdateDataRequest) => Promise<ApiResponse<void>>; export declare const getTokenDetails: (params: { app_user_id: string; call_type: string; }) => Promise<ApiResponse<TokenDetails>>; //# sourceMappingURL=api.d.ts.map