@olakai/sdk
Version:
This document demonstrates how to use the Olakai SDK with all its features.
31 lines • 1.18 kB
TypeScript
import type { SDKConfig, MonitorPayload, ControlPayload } from "./types";
/**
* Initialize the SDK
* @param apiKey - The API key
* @param domainUrl - The domain URL
* @param options - The extra options for the SDKConfig
* @default options - {
* retries: 4,
* timeout: 30000,
* debug: false,
* verbose: false,
* version: packageJson.version,
* }
* @throws {URLConfigurationError} if the API URL is not set
* @throws {APIKeyMissingError} if the API key is not set
*/
export declare function initClient(apiKey: string, domainUrl: string, options?: Partial<SDKConfig>): Promise<void>;
/**
* Get the current configuration
* @returns The current configuration
* @throws {ConfigNotInitializedError} if the config is not initialized
*/
export declare function getConfig(): SDKConfig;
/**
* Send a payload to the API (simplified - no queueing)
* @param payload - The payload to send to the endpoint
* @param role - The role of the API call
* @returns A promise that resolves when the payload is sent
*/
export declare function sendToAPI(payload: MonitorPayload | ControlPayload, role?: "monitoring" | "control"): Promise<void>;
//# sourceMappingURL=client.d.ts.map