@belticlabs/kya package provides Beltic credential utilities for Node 18+ and
modern runtimes. It mirrors the CLI capabilities with a developer-friendly API.
Install
Quick start
API highlights
Validation
validateDeveloperCredential(input)andvalidateAgentCredential(input)return{ valid, data, errors, warnings }.- Validates against the official FACT v1 JSON schemas.
HTTP Signature Verification
verifyHttpSignature(request, options)verifies RFC 9421 HTTP Message Signatures.fetchKeyDirectory(url)fetches and parses a key directory from a URL.fetchAgentCredential(signatureAgentUrl)fetches credential from key directory.
Key Directory
generateKeyDirectory(options)generates a key directory JSON for Web Bot Auth.signDirectoryResponse(directory, options)signs the directory response.
Token Operations
decodeToken(jwt)decodes JWS/JWT tokens without verification.- Type detection based on
typheader.
Type guards
isDeveloperCredentialandisAgentCredentialrefine types at runtime.
Developer credential example (SDK)
Agent credential example (SDK)
HTTP Signature Verification Example
Requirements
- Node 18 or newer; ES2022 support.
- Use alongside the Beltic schemas from
beltic-specfor validation parity with the CLI.
Examples and fixtures
- Human-readable examples:
beltic-spec/examples/developer-example-v1.mdandbeltic-spec/examples/agent-example-v1.md. - JSON fixtures for tests:
beltic-spec/examples/developer/v1/tests/*andbeltic-spec/examples/agent/v1/tests/*(valid and invalid cases). - Pair SDK validation with those fixtures to mirror CLI behavior while schemas remain in-repo.
Framework Integrations
Use Beltic with popular agent frameworks to make your agents’ HTTP requests verifiable:Claude Agent SDK
Sign requests from Claude-powered autonomous agents
LangChain.js
Create signed API tools for LangChain agents