HttpService
HTTP client wrapper for making authenticated API requests to AuthSafe endpoints.
Overview
The HttpService provides a convenient wrapper around Axios for HTTP requests with automatic Bearer token injection and error handling. Pre-configured with Base URL, Content-Type, Cache-Control, and Authorization headers with a default timeout of 10 seconds.
Basic Usage
import { HttpService } from 'authsafe-ts';
const user = await oauthService.getUser();
const httpService = new HttpService(user?.access_token);
const userInfo = await httpService.get('/auth/userinfo');