HyperWiz Logo
v1.2.0StableTypeScript

Lightweight HTTP Client
with Smart Caching

A lightweight, zero-dependency HTTP client library with powerful interceptors, auto retry, smart caching, and complete HTTP method support. Simple setup, full TypeScript support, and complete developer control.

...weekly downloads
...unpacked size

Quick Start in 30 seconds

1
Install the package
Install
npm install hyperwiz
2
Start using it
TypeScript
import { createClient } from 'hyperwiz';

const api = createClient('https://api.example.com', { 
  logging: true, 
  retry: true,
  cache: true 
});

const users = await api.get('/users');
const newUser = await api.post('/users', { name: 'John' });

Why choose hyperwiz?

Built for modern web applications with simplicity, flexibility, and developer experience in mind.

Simple Setup

One-line client creation with zero configuration needed. Get started in minutes, not hours.

Zero-config setup

Flexible Interceptors

Add request/response/error handlers with powerful interceptor system for complete control.

Complete control

Auto Retry

Adaptive backoff with exponential delay and intelligent retry logic for reliable requests.

Adaptive backoff

Smart Caching

In-memory or IndexedDB caching with automatic expiration and intelligent cache management.

Auto-expiration

Cookie Support

Works with credentials and cross-origin requests for session-based authentication.

Cross-origin ready

TypeScript First

Full TypeScript support with excellent IntelliSense and type safety throughout.

100% type coverage

See it in Action

Explore real-world examples and get started with HyperWiz in minutes.

Basic HTTP Methods

TypeScript
import { createClient } from 'hyperwiz';

const api = createClient('https://api.example.com');

// GET request
const users = await api.get('/users');

// POST request
const newUser = await api.post('/users', { 
  name: 'John', 
  email: 'john@example.com' 
});

// PUT request
const updatedUser = await api.put('/users/1', { 
  name: 'John Updated' 
});

// DELETE request
const deleted = await api.delete('/users/1');

Auto Retry with Interceptors

TypeScript
const api = createClient('https://api.example.com', {
  retry: {
    maxRetries: 3,
    retryDelay: 1000,
    backoffMultiplier: 2
  },
  logging: true
});

// Add token interceptor
api.addBefore((config, url) => {
  const token = localStorage.getItem('token');
  if (token) {
    return {
      ...config,
      headers: {
        ...config.headers,
        'Authorization': `Bearer ${token}`
      }
    };
  }
  return config;
});

// All requests automatically retry and include tokens
const profile = await api.get('/user/profile');

Smart Caching

TypeScript
const api = createClient('https://api.example.com', {
  cache: {
    enabled: true,
    maxAge: 5 * 60 * 1000,  // Cache for 5 minutes
    maxSize: 50,             // Maximum 50 cached items
    storage: 'indexeddb',    // Use IndexedDB for persistence
    includeQueryParams: true, // Include query params in cache key
    cacheableMethods: ['GET', 'HEAD'], // Cache GET and HEAD requests
    cacheableStatusCodes: [200, 304]   // Cache 200 and 304 responses
  },
  logging: true
});

// First request: fetches from server
const users1 = await api.get('/users'); // ⏳ Network request

// Second request: served from cache (instant)
const users2 = await api.get('/users'); // 💾 Cache hit (instant)

// Check if user exists without downloading data
const userExists = await api.head('/users/123');

// Get allowed methods for CORS
const capabilities = await api.options('/users');

Ready to get started?

Join thousands of developers using HyperWiz for simple, flexible, and reliable HTTP requests with smart caching.

Or install it right now:

Terminal
npm install hyperwiz