RegisterLogin
DocsPricing
RegisterLogin
  • Getting Started
  • Introduction
  • Quick Start
  • SDKs
  • React
  • TypeScript
  • Next.js
  • Express
  • NestJS
  • Python
  • API Reference
  • Support and Resources
  • FAQ
  • Contact

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');

Best Practices
  • HttpService is designed to be used with API clients (MfaApi, UserApi) rather than directly
  • 401 Unauthorized automatically throws an error for redirect handling
  • Default timeout is 10 seconds — adjust as needed for your use case

AuthSafe

Product

HighlightFeatureIntegrationPricingFAQ

Company

AboutBlogContact

Developer

DashboardDocumentation

Legal

Terms & ConditionsPrivacyComplianceShippingCancellationAI

© 2026 AuthSafe. All rights reserved.

We value your privacy

This website uses cookies for anonymous analytics to help us improve your experience. No personal information is stored or shared. You can allow or reject analytics tracking at any time. See our Privacy Policy.

We use cookies for anonymous analytics. No personal info is stored. See our Privacy Policy.