Skip to content

ESPRMAPIManager

Defined in: src/services/ESPRMAPIManager.ts:27

HTTP client for the ESP RainMaker API, built on the Fetch API. Configured once via ESPRMBase.configure; all SDK methods route through ESPRMAPIManager.authorizeRequest or ESPRMAPIManager.request.

static authorizeRequest(requestConfig): Promise<any>

Defined in: src/services/ESPRMAPIManager.ts:58

Send a request with the current user’s access token in the Authorization header, refreshing the token first if it has expired. A 401 response clears the stored session and rethrows with additionalInfo set to AdditionalInfo.AUTHENTICATION_REQUIRED.

If requestConfig.baseURL is set, the token is sent to that host. Only use it for the trusted ESP RainMaker deployment.

ESPRMRequestConfig

Promise<any>


static initialize(config): void

Defined in: src/services/ESPRMAPIManager.ts:38

ESPRMAPIManagerConfig

void


static request(requestConfig): Promise<any>

Defined in: src/services/ESPRMAPIManager.ts:92

Send an unauthenticated request. Non-2xx responses and network/timeout failures reject with an ESPAPIError.

ESPRMRequestConfig

Promise<any>