Skip to main content
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

Package Structure (v1.3.1+)

The Beltic SDK is organized into focused packages for smaller bundle sizes:
PackagePurposeUse When
@belticlabs/kyaMain package (re-exports all)Most applications
@belticlabs/kya-coreShared types and utilitiesCustom integrations
@belticlabs/verifierVerify incoming agent requestsBackend services
@belticlabs/agent-signerSign credentials and HTTP requestsAgent implementations
For most applications, use the main package which re-exports everything:
npm install @belticlabs/kya

Optimized: 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

FrameworkRecommended PackageUse Case
Claude Agent SDK@belticlabs/agent-signerSign outgoing HTTP requests via MCP server
LangChain.js@belticlabs/agent-signerCreate signed API tools
Express/Node@belticlabs/verifierVerify 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

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 team at beltic dot com or visit our Feedback page.

Next Steps

Validation

Validate credentials against schemas

Signing & Verification

Sign and verify credentials