OpenAgentIDDocumentation
API referencenpm packages@openagentid/http
OpenAgentIDAPI reference

@openagentid/http/client

API contract shipped by @openagentid/http 0.1.1. Exact exports, signatures, dependencies and availability.

All packages · Runnable examples · Start an agent

ContractValue
Package@openagentid/http@0.1.1
Entry point@openagentid/http/client
AvailabilityKnown integration limitations
Reference sourcePublished TypeScript declarations
Package enginesnode >=20

Before integrating

Declares an optional peer on @openagentid/auth-protocol ^0.1.0; the registry returns 404 for that peer package.

Published adapter has not qualified for the current production path. Use current SDK identity verification and explicit receiver policy.

This reference is generated from the integrity-verified npm archive for this exact version. Signatures describe the public contract; they are not standalone programs. Complete examples are checked separately.

Import conditions

Use the public entry point above. The package resolves it to these shipped files; do not import its internal files directly.

ConditionPublished file
types./dist/client.d.ts
import./dist/client.js
require./dist/client.cjs

Exports

ClientConfig

Client configuration.

Type-only declaration; it is not a runtime value.

Signature
interface ClientConfig {
    did: string;
    keyType?: KeyType;
    timeoutMs?: number;
}

Source: @openagentid/http@0.1.1, dist/client.d.ts:13.

HttpAuthClient

HTTP client that performs the Core Protocol identity flow.

Usage:

Signature
declare class HttpAuthClient {
    constructor(params: {
        config: ClientConfig;
        sign: SignFn;
        publicKey: () => Promise<string>;
        transport?: HttpTransport;
    });
    authenticate(baseUrl: string): Promise<AuthenticatedSession>;
}

Source: @openagentid/http@0.1.1, dist/client.d.ts:47.

SignFn

Function that signs a payload and returns a base64url (no padding) encoded signature.

The caller provides this — it may use

Type-only declaration; it is not a runtime value.

Signature
type SignFn = (payload: Uint8Array) => Promise<string>;

Source: @openagentid/http@0.1.1, dist/client.d.ts:32.

openagentid: /crypto-wasm, Web Crypto, or any Ed25519 implementation.

Supporting declarations

These package-owned declarations are referenced by the exports above. Their presence here does not make them importable from this entry point. Import only the names in Exports.

AuthenticatedSession

An authenticated HTTP session obtained after a successful Core Protocol identity flow.

Signature
declare class AuthenticatedSession {
    constructor(params: {
        baseUrl: string;
        sessionId: string;
        peerDid: string;
        sessionToken: string;
        expiresAt: number;
    });
    isExpired(): boolean;
    getSessionId(): string;
    getPeerDid(): string;
    getBaseUrl(): string;
    fetch(path: string, init?: RequestInit): Promise<Response>;
    get(path: string): Promise<Response>;
    post(path: string, body: unknown): Promise<Response>;
    put(path: string, body: unknown): Promise<Response>;
    delete(path: string): Promise<Response>;
}

Source: @openagentid/http@0.1.1, dist/session.d.ts:8.

HttpTransport

HTTP transport carrying the identity flow over REST.

Signature
declare class HttpTransport {
    constructor(config?: HttpTransportConfig);
    fetchChallenge(endpoint: string): Promise<IdentityChallenge>;
    prove(endpoint: string, proof: IdentityProof): Promise<IdentityVerified>;
}

Source: @openagentid/http@0.1.1, dist/transport.d.ts:111.

HttpTransportConfig

Configuration for the HTTP transport.

Type-only declaration; it is not a runtime value.

Signature
interface HttpTransportConfig {
    timeoutMs?: number;
    headers?: Record<string, string>;
}

Source: @openagentid/http@0.1.1, dist/transport.d.ts:104.

IdentityChallenge

Server → Agent: a cryptographic challenge (Section 15.2).

Type-only declaration; it is not a runtime value.

Signature
interface IdentityChallenge {
    type: string;
    nonce: string;
    timestamp: string;
    origin: string;
    realm?: string;
}

Source: @openagentid/http@0.1.1, dist/transport.d.ts:14.

IdentityProof

Agent → Server: the cryptographic proof of identity (Section 15.3).

Type-only declaration; it is not a runtime value.

Signature
interface IdentityProof {
    signature: string;
    public_key: string;
    key_type: KeyType;
    nonce: string;
}

Source: @openagentid/http@0.1.1, dist/transport.d.ts:28.

IdentityVerified

Server → Agent: identity confirmed; session issued (Section 15.4).

Type-only declaration; it is not a runtime value.

Signature
interface IdentityVerified {
    did: string;
    trust_tier: TrustTier;
    session_token: string;
    session_expires: string;
    capabilities?: string[];
}

Source: @openagentid/http@0.1.1, dist/transport.d.ts:40.

KeyType

Signature scheme for a proof (Section 15.3).

Type-only declaration; it is not a runtime value.

Signature
type KeyType = 'ed25519' | 'secp256k1';

Source: @openagentid/http@0.1.1, dist/transport.d.ts:26.

TrustTier

The resolution tier the server assigns (Section 15.4).

Type-only declaration; it is not a runtime value.

Signature
type TrustTier = 'anonymous' | 'identified' | 'sovereign';

Source: @openagentid/http@0.1.1, dist/transport.d.ts:38.

Package requirements

Dependencies

PackagePublished range
zod^3.23.8

Peer dependencies

PackagePublished rangeOptional
@openagentid/auth-protocol^0.1.0Yes

Archive verification

Pinned integrity:

SHA-512 integrity
sha512-Ecd1WkgKIlAusRSIeeyRuTXIMUka8QwTiWh8JRoxwA5i2MrT4xuza1kNXe4w+O0PTWMousqpc/Val2cNXKoNQQ==

Machine-readable API manifest · Coverage

On this page