@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
| Contract | Value |
|---|---|
| Package | @openagentid/http@0.1.1 |
| Entry point | @openagentid/http/client |
| Availability | Known integration limitations |
| Reference source | Published TypeScript declarations |
| Package engines | node >=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.
| Condition | Published file |
|---|---|
| types | ./dist/client.d.ts |
| import | ./dist/client.js |
| require | ./dist/client.cjs |
Exports
ClientConfig— typeHttpAuthClientSignFn— type
ClientConfig
Client configuration.
Type-only declaration; it is not a runtime value.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
type TrustTier = 'anonymous' | 'identified' | 'sovereign';Source: @openagentid/http@0.1.1, dist/transport.d.ts:38.
Package requirements
Dependencies
| Package | Published range |
|---|---|
| zod | ^3.23.8 |
Peer dependencies
| Package | Published range | Optional |
|---|---|---|
| @openagentid/auth-protocol | ^0.1.0 | Yes |
Archive verification
Pinned integrity:
sha512-Ecd1WkgKIlAusRSIeeyRuTXIMUka8QwTiWh8JRoxwA5i2MrT4xuza1kNXe4w+O0PTWMousqpc/Val2cNXKoNQQ==