@limitly/limitly-nextjs
Version:
Official Next.js SDK for Limitly - API Key management, plans, users and request validation optimized for server-side
58 lines • 2.12 kB
TypeScript
import { LimitlyConfig, RequestOptions } from './types';
/**
* HTTP client for making requests to the Limitly API
* Optimized for Next.js server-side rendering
*/
export declare class HttpClient {
private readonly apiKey;
private readonly baseUrl;
private readonly timeout;
constructor(config: LimitlyConfig);
/**
* Makes an HTTP request to the Limitly API
* @param endpoint - The API endpoint to call
* @param options - Axios request configuration
* @param requestOptions - Additional request options including Next.js specific options
* @returns Promise with the response data
*/
private makeRequest;
/**
* Makes a GET request to the API with Next.js cache support
* @param endpoint - The API endpoint
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
get<T>(endpoint: string, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a POST request to the API
* @param endpoint - The API endpoint
* @param body - Request body data
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
post<T>(endpoint: string, body?: any, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a PUT request to the API
* @param endpoint - The API endpoint
* @param body - Request body data
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
put<T>(endpoint: string, body?: any, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a DELETE request to the API
* @param endpoint - The API endpoint
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
delete<T>(endpoint: string, requestOptions?: RequestOptions): Promise<T>;
/**
* Gets the base URL for debugging purposes
*/
getBaseUrl(): string;
/**
* Gets the API key (masked for security)
*/
getApiKey(): string;
}
//# sourceMappingURL=client.d.ts.map