Phtps in action

Live
REQUEST
200 OK
await client.get('/users')
// → { data: [...], meta }
await client.post('/auth', body)
PLUGINS
encryption
cache
resilience
hmac-sign
PIPELINE
Resolve interceptors
Encrypt payload
Sign HMAC token
Send request
npm install @pings/phtps
Zero dependencies
TypeScript native
Full type safety
$npm install @pings/phtps|
HTTP Client for the Modern Web

Build applications, not HTTP infrastructure.

A TypeScript-first HTTP client with retries, caching, authentication, streaming, and extensible plugins built on native fetch.

Core Capabilities

Plugin Architecture

Every capability is opt-in. Add encryption, caching, retries, or HMAC signing without touching your existing code.

Zero Config, Full Control

Sensible defaults that get out of your way. Override anything with a single option when the time comes.

Every Runtime

Node.js 18+, React, Vue, Angular, Deno, Bun, JavaScript. One API, everywhere.

16 Plugins
Zero Dependencies
TypeScript First
Framework Agnostic
Key Features

Powerful enough for production.
Surgical enough for you.

A modular architecture where every capability is a plugin. Add what you need, ship what matters.

core.api

Familiar API

Drop-in replacement. Use .get, .post, .put, .patch, .delete and start shipping without rewiring your mental model.

const client = Phtps.create({
baseURL: '/api'
})
const data = await client.get('/users')
plugin.middleware

Interceptors & Middleware

Axios-style global interceptors plus Koa-style pipeline composition for requests and responses.

req
use()
res
plugin.encryption

Payload Encryption

AES-GCM encryption powered by the native Web Crypto API. Zero-config, zero-overhead.

plugin.csrf

CSRF Protection

Automatic anti-forgery token extraction and injection.

core.progress

Progress Tracking

High-fidelity upload and download events via XHR or the Streams API.

GET /users
POST /auth
PUT /data
DELETE /old
plugin.dedupe

Request Deduplication

Simultaneous identical GET requests are merged into a single network call. One request, many consumers.

plugin.cache

Smart Caching

TTL-based GET caching with customizable storage adapters. Slash redundant network load.

TTL5 min cache
core.pagination

Auto-Pagination

Predictive prefetching and automatic aggregate loop fetching for long lists.

Page4 / 12
PrefetchON
Total240
Active
core.streaming

Advanced Streaming

First-class API for Text, NDJSON, SSE, and raw byte streaming.

Text
NDJSON
SSE
Bytes
core.multi-tenant

Multi-Tenant Support

Fork isolated client instances via .create() — each with its own scoped plugin state.

plugin.resilience

Resilience

Smart retries with exponential backoff, jitter, and fully custom retry predicates.

max retries
plugin.payment-security

Payment Security

AWS-style HMAC signing, idempotency keys, and PII masking in a zero-trust module.

HMACSHA-256
PIIMasked
Key✓ Valid
Active
plugin.queue

Queue Management

Concurrency limits, pause/resume, and sequential request processing out of the box.

GET /users
POST /auth
PUT /data
DELETE /old
plugin.token

Token Management

Proactive background refresh window plus reactive 401 interceptor for seamless token rotation.

core.cancel

Cancellation

Deep AbortController support for ongoing and queued requests.

core.agnostic

Framework Agnostic

Node.js 18+, React, Vue, Angular, or Vanilla JS. Your stack, your choice.

Supported Ecosystem

Works everywhere you do

Node.js 18+ · React · Vue · Angular · Deno · Bun · Next.js · JavaScript · TypeScript

150+ runtime & framework combinations

Become a Sponsor

Support our open-source mission and get your brand in front of thousands of developers.

Code that feels like art.

A surgical API designed to stay out of your way.

import Phtps from 'Phtps';
// Create an instance
const api = Phtps.create({
baseURL: 'https://api.myapp.com/v1',
timeout: 5000,
});
// Use it like you're used to
const { data } = await api.get('/users/me');
console.log(data);

Build applications, not HTTP infrastructure.

Join thousands of developers building more resilient apps with Phtps.

npm install @pings/phtps