Beltic logo
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/kya

Or with other package managers:

# yarn
yarn add @belticlabs/kya

# pnpm
pnpm add @belticlabs/kya

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

FeatureDescription
ValidationValidate credentials against v1 JSON schemas
HTTP SignaturesVerify RFC 9421 HTTP Message Signatures
Key DirectoryGenerate and sign key directories for Web Bot Auth
Type GuardsRuntime type checking for credentials
Token DecodingParse 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.

Next Steps