Overview
Provider-neutral, origin-locked HTTP for AbsoluteJS applications.
@absolutejs/httpv0.0.1betaData & SyncOrigin-locked, authentication-aware HTTP transport for AbsoluteJS applications
bun add @absolutejs/httpProvider-neutral, origin-locked HTTP for AbsoluteJS applications.
Application code stays the same across browser, PWA, and Capacitor builds. The browser transport uses same-origin HTTP-only cookies. AbsoluteJS installs the Capacitor transport with the native Auth client's renewable bearer credential; tokens never enter page code.
Relative URLs resolve against one configured application origin.
Absolute URLs must match that exact origin.
HTTPS is required outside loopback development.
Application-provided Authorization, Cookie, and Proxy-Authorization
headers are rejected. The runtime provider owns credentials.
Redirect following is disabled for trusted requests, preventing a server
redirect from becoming a credential or request-body forwarding channel.
HTTP errors expose status and URL but do not automatically copy a private
response body into an exception or diagnostic.
Use http.request() when you need a raw Response, http.text() for text, and http.json() or the method helpers for JSON. @absolutejs/sync remains the durable local-first API; ordinary HTTP is connected-first.
Type parameters describe the decoded result at the call site. For end-to-end route inference, pass http.fetch into the Elysia Eden client used by your application so Eden retains the server route types while AbsoluteJS owns the runtime transport.
SSR code must install or construct a request-scoped transport rather than guessing a public origin:
Tests can use createTestHttpTransport() from @absolutejs/http/testing.
Outcomes
Provider-neutral, origin-locked HTTP for AbsoluteJS applications.
Relative URLs resolve against one configured application origin.
SSR code must install or construct a request-scoped transport rather than guessing a public origin:
Hardening checklist
Follow in order
# @absolutejs/http
import { http } from '@absolutejs/http';
const orders = await http.get<Order[]>('/api/orders');
await http.post('/api/orders', { sku: 'absolute-shirt', quantity: 1 });SSR code must install or construct a request-scoped transport rather than guessing a public origin:
import { createAbsoluteHttpClient } from '@absolutejs/http';
import { createSsrHttpTransport } from '@absolutejs/http/ssr';
const http = createAbsoluteHttpClient({
transport: createSsrHttpTransport({
origin: 'https://app.example.com'
})
});Supported entry points declared by this project’s package manifest. Internal dist paths are not part of the package contract.
Public package entry point declared in package.json.
Scripts declared by this project’s package manifest.
Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.
type AbsoluteHttpRuntime = 'native' | 'ssr' | 'test' | 'web';@absolutejs/http