@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
Package 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:Optimized: Use Focused Packages
For smaller bundle sizes, import from specific packages: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 |
TypeScript Configuration
Add totsconfig.json:
Verify Installation
Basic Import
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 |
Next Steps
Validation
Validate credentials against schemas
Signing & Verification
Sign and verify credentials