SDK Installation
Install and configure the Beltic TypeScript SDK for Node.js 18+ applications.
The @belticlabs/kya package provides credential validation, signing, verification, and trust chain functionality for JavaScript runtimes.
Prerequisites
- Node.js 18+ (ES2022 support)
- TypeScript 5.0+ (recommended)
- Package manager: npm, yarn, or pnpm
Installation
npm install @belticlabs/kyaOr with other package managers:
# yarn
yarn add @belticlabs/kya
# pnpm
pnpm add @belticlabs/kyaPackage Structure (v1.3.1+)
The Beltic SDK is organized into focused packages for smaller bundle sizes:
| Package | Purpose | Use When |
|---|---|---|
@belticlabs/kya | Main package (re-exports all) | Most applications |
@belticlabs/kya-core | Shared types and utilities | Custom integrations |
@belticlabs/verifier | Verify incoming agent requests | Backend services |
@belticlabs/agent-signer | Sign credentials and HTTP requests | Agent implementations |
Recommended: Use the Main Package
For most applications, use the main package which re-exports everything:
npm install @belticlabs/kyaOptimized: Use Focused Packages
For smaller bundle sizes, import from specific packages:
// Backend: Only verification (smaller bundle)
import { verifyAgentRequest } from '@belticlabs/verifier';
// Agent: Only signing (smaller bundle)
import { signHttpRequest, signCredential } from '@belticlabs/agent-signer';
// Shared types
import type { AgentCredential, DeveloperCredential } from '@belticlabs/kya-core';Framework-Specific Recommendations
| Framework | Recommended Package | Use Case |
|---|---|---|
| Claude Agent SDK | @belticlabs/agent-signer | Sign outgoing HTTP requests via MCP server |
| LangChain.js | @belticlabs/agent-signer | Create signed API tools |
| Express/Node | @belticlabs/verifier | Verify incoming agent requests |
See Framework Integrations for complete examples.
TypeScript Configuration
Add to tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true
}
}Verify Installation
import { validateDeveloperCredential } from '@belticlabs/kya';
console.log('Beltic SDK loaded successfully');Basic Import
import {
// Validation
validateDeveloperCredential,
validateAgentCredential,
isDeveloperCredential,
isAgentCredential,
// Token operations
decodeToken,
// HTTP signature verification
verifyHttpSignature,
fetchKeyDirectory,
fetchAgentCredential,
// Key directory generation
generateKeyDirectory,
signDirectoryResponse,
// Type guards
AgentCredential,
DeveloperCredential,
} from '@belticlabs/kya';SDK Capabilities
| Feature | Description |
|---|---|
| Validation | Validate credentials against v1 JSON schemas |
| HTTP Signatures | Verify RFC 9421 HTTP Message Signatures |
| Key Directory | Generate and sign key directories for Web Bot Auth |
| Type Guards | Runtime type checking for credentials |
| Token Decoding | Parse and decode JWS/JWT tokens |
Help shape the SDK - If you're building with the TypeScript SDK or have ideas for better APIs, error handling, or developer experience, we want to hear from you. Your feedback helps us build better tools for developers. Contact pranav at beltic dot com or visit our Feedback page.