UNPKG

ministry-platform-provider

Version:

TypeScript client library for Ministry Platform API integration

31 lines (30 loc) 1.13 kB
import { HttpClient } from "../utils/httpClient.js"; /** * MinistryPlatformClient - Core HTTP client with automatic authentication management * * Manages OAuth2 client credentials authentication and provides a configured HttpClient * instance for all Ministry Platform API operations. Handles token lifecycle including * automatic refresh before expiration. */ export declare class MinistryPlatformClient { private token; private expiresAt; private baseUrl; private httpClient; /** * Creates a new MinistryPlatformClient instance * Initializes the HTTP client and sets up token management */ constructor(); /** * Ensures the authentication token is valid and refreshes if necessary * This method should be called before making any API requests to guarantee authentication * @throws Error if token refresh fails */ ensureValidToken(): Promise<void>; /** * Returns the configured HTTP client instance for making authenticated requests * @returns HttpClient instance with automatic token injection */ getHttpClient(): HttpClient; }