SDK Guide
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/kyaTypeScript 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.