@envkit/nextjs
Version:
Environment variable management for Next.js applications
43 lines (42 loc) • 1.28 kB
TypeScript
/**
* EnvKit API client for managing environment variables
* This module provides a client-side API for environment variable management
* IMPORTANT: This file must not import any server-only modules
*/
export interface EnvKitApiOptions {
baseUrl?: string;
headers?: Record<string, string>;
}
export type EnvVarUpdatePayload = Record<string, string>;
export interface EnvVarStatus {
success: boolean;
missingVars: string[];
error?: string;
}
/**
* EnvKit API client for managing environment variables
* This is safe to use in client components
*/
export declare class EnvKitApi {
private baseUrl;
private headers;
constructor(options?: EnvKitApiOptions);
/**
* Check the status of environment variables
* @returns Promise with the status of environment variables
*/
private statusCache;
private lastCheckTime;
private readonly CACHE_TTL;
checkStatus(): Promise<EnvVarStatus>;
/**
* Update environment variables
* @param variables The environment variables to update
* @returns Promise with the result of the update
*/
updateVariables(variables: EnvVarUpdatePayload): Promise<{
success: boolean;
error?: string;
}>;
}
export declare const envKitApi: EnvKitApi;