@koia-ai/koia-eshop-sdk
Version:
A configurable React context provider for e-commerce functionality with cart management, discount codes, order processing, and API client for product management
35 lines • 1.08 kB
TypeScript
import { Product, ApiResponse } from '../types';
export declare class EshopClient {
private apiKey;
private baseUrl;
constructor(apiKey: string, baseUrl?: string);
/**
* Normalize and validate the base URL
*/
private normalizeBaseUrl;
/**
* Get authentication headers for API requests
*/
private getAuthHeaders;
/**
* Test the API connection
*/
testConnection(): Promise<{
success: boolean;
error?: string;
}>;
/**
* Fetch products from the API
* @param organizationId - The organization ID to fetch products for
* @returns Promise with products data or error
*/
getProducts(organizationId: string): Promise<ApiResponse<Product[]>>;
/**
* Generic method to make authenticated API requests
* @param endpoint - API endpoint path
* @param options - Fetch options
* @returns Promise with response data or error
*/
makeRequest<T>(endpoint: string, options?: RequestInit): Promise<ApiResponse<T>>;
}
//# sourceMappingURL=EshopClient.d.ts.map