AbsoluteJS

HTTP

@absolutejs/httpv0.0.1betaData & Sync

Origin-locked, authentication-aware HTTP transport for AbsoluteJS applications

#Installation

BASH
bun add @absolutejs/http

#Capabilities

Overview

Provider-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.

Security contract

Relative URLs resolve against one configured application origin.

Absolute URLs must match that exact origin.

HTTPS is required outside loopback development.

Show 8 more

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.

Explicit transports

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

What you can build

Overview

Provider-neutral, origin-locked HTTP for AbsoluteJS applications.

Security contract

Relative URLs resolve against one configured application origin.

Explicit transports

SSR code must install or construct a request-scoped transport rather than guessing a public origin:

Hardening checklist

Production guidance

Security contractRelative URLs resolve against one configured application origin.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/http example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#@absolutejs/http quick start

Partial snippet

# @absolutejs/http

TS
import { http } from '@absolutejs/http';

const orders = await http.get<Order[]>('/api/orders');
await http.post('/api/orders', { sku: 'absolute-shirt', quantity: 1 });

#Explicit transports

Partial snippet

SSR code must install or construct a request-scoped transport rather than guessing a public origin:

TS
import { createAbsoluteHttpClient } from '@absolutejs/http';
import { createSsrHttpTransport } from '@absolutejs/http/ssr';

const http = createAbsoluteHttpClient({
	transport: createSsrHttpTransport({
		origin: 'https://app.example.com'
	})
});

#Public entry points

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.

@absolutejs/http@absolutejs/http/conformance@absolutejs/http/runtime@absolutejs/http/ssr@absolutejs/http/testing@absolutejs/http/web

#Package commands

Scripts declared by this project’s package manifest.

bun run buildrm -rf dist && bun build src/index.ts --root src --outdir dist --target=browser --sourcemap && bun build src/conformance.ts --root src --outdir dist --target=browser --sourcemap && bun build src/runtime.ts --root src --outdir dist --target=browser --sourcemap && bun build src/ssr.ts --root src --outdir dist --target=browser --sourcemap && bun build src/testing.ts --root src --outdir dist --target=browser --sourcemap && bun build src/web.ts --root src --outdir dist --target=browser --sourcemap && tsc --emitDeclarationOnly -p tsconfig.build.json
bun run checkbun run typecheck && bun test && bun run build && bun run verify:dist
bun run check:packageabsolute-changelog check
bun run formatprettier --write .
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

13 symbols
AbsoluteHttpRuntimetypePermalink
TS
type AbsoluteHttpRuntime = 'native' | 'ssr' | 'test' | 'web';
Exported from @absolutejs/http