getting-started
Installation

Installation

Veridex now provides a protocol layer and a runtime layer:

  • @veridex/sdk — Core SDK for passkey wallets, vaults, sessions, cross-chain transfers, and wallet backup/recovery
  • @veridex/agentic-payments — Agent SDK for autonomous AI agent payments, x402 protocol, and MCP tools
  • @veridex/agents — General-purpose TypeScript agent runtime
  • @veridex/agents-react — React hooks and provider for the runtime
  • @veridex/agents-adapters — Adapters and live bridges for external runtimes
  • @veridex/agents-openclaw — OpenClaw / Pi compatibility bridge
  • @veridex/agents-control-plane — Control-plane service and client for approvals, traces, policy, and audit

Prerequisites

  • Node.js 18+ or Bun
  • A browser frontend for passkey operations (see note below)
  • A WebAuthn-compatible browser (Chrome, Safari, Firefox, Edge)
  • TypeScript 5.0+ (recommended)
  • ethers v6 (peer dependency for the core SDK)
⚠️

Frontend Required for Passkeys: The core SDK uses WebAuthn browser APIs for passkey registration and authentication. These operations (sdk.passkey.register(), sdk.passkey.authenticate()) must run in a client-side browser context (HTTPS or localhost) — they cannot run in Node.js, server components, or CLI scripts. You need a frontend (React, Next.js, plain HTML, etc.) to create and authenticate passkeys. Server-side code can handle balance queries, transaction verification, and relayer calls, but the initial passkey creation must happen in the browser.

Agent SDK Exception: The Agent SDK (@veridex/agentic-payments) runs server-side in Node.js, but it requires a masterCredential that was originally created via a browser frontend. The typical flow is: human creates passkey in browser → configures spending limits → agent backend receives credentials and operates autonomously within those limits.

Install the Core SDK

For building passkey-authenticated wallets and dApps:

npm install @veridex/sdk ethers

Install the Agent SDK

For building autonomous AI agents that can make payments:

npm install @veridex/agentic-payments

The Agent SDK (@veridex/agentic-payments) includes @veridex/sdk as a dependency and re-exports core functions like createSDK and generateSecp256k1KeyPair for convenience.

Install the Agents Framework

For general-purpose agents, workflow-style orchestration, interop, and enterprise control:

npm install @veridex/agents zod
npm install @veridex/agents-react @veridex/agents-adapters @veridex/agents-openclaw @veridex/agents-control-plane
⚠️

The new framework packages are implemented and usable, but still evolving. Some APIs may still change and parts of the docs may still be catching up. We welcome fixes and feedback.

Package Comparison

Feature@veridex/sdk@veridex/agentic-payments
Passkey registration & login✅ (via re-export)
Vault management
Session key managementSessionManagerSessionKeyManager (enhanced)
Spending limitsSpendingLimitsManagerSpendingTracker (USD-aware)
Cross-chain transfersCrossChainRouter
ERC-8004 low-level utilitieserc8004/ module✅ (via re-export)
ERC-8004 identity clientsIdentityClient, ReputationClient
Registration file managementRegistrationFileManager
Trust gates & reputationTrustGate, ReputationPipeline
Agent discoveryAgentDiscovery
Protocol detection (x402/UCP/ACP/AP2)ProtocolDetector
AI agent orchestrationAgentWallet
MCP tools (Claude/Cursor)MCPServer
UCP credentialsUCPCredentialProvider
Audit logging & complianceAuditLogger, ComplianceExporter
Multi-chain clientsEVM, Solana, Aptos, Sui, Starknet, Stacks, MonadAll + MonadChainClient, StacksChainClient
Pyth price oraclePythOracle

Agent Fabric Package Comparison

PackageMain jobBest for
@veridex/agentsRuntime coreTools, hooks, memory, checkpoints, transports, policy-aware runs
@veridex/agents-reactUI integrationReact chat, approvals, trace views, budget and identity dashboards
@veridex/agents-adaptersImport/export and bridgesLangGraph, OpenAI Agents, PydanticAI, OpenAPI migration
@veridex/agents-openclawOpenClaw / Pi interopSkill import, context-file import, ACP collaboration
@veridex/agents-control-planeGovernance planeTenants, approvals, policy packs, traces, audit export, remote service

TypeScript Configuration

For TypeScript projects, ensure your tsconfig.json includes:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "esModuleInterop": true,
    "strict": true
  }
}

Browser Support

Veridex uses WebAuthn (Passkeys) which requires:

BrowserMinimum Version
Chrome67+
Safari14+
Firefox60+
Edge79+

Passkeys require a secure context (HTTPS) in production. For local development, localhost is allowed.

Framework Integration

React / Next.js (Core SDK)

// lib/veridex.ts
import { createSDK } from '@veridex/sdk';
 
export const sdk = createSDK('base', {
  network: 'testnet',
  relayerUrl: process.env.NEXT_PUBLIC_RELAYER_URL,
});

Node.js / Backend (Agent SDK)

// agent.ts
import { createAgentWallet } from '@veridex/agentic-payments';
 
const agent = await createAgentWallet({
  masterCredential: {
    credentialId: process.env.CREDENTIAL_ID!,
    publicKeyX: BigInt(process.env.PUBLIC_KEY_X!),
    publicKeyY: BigInt(process.env.PUBLIC_KEY_Y!),
    keyHash: process.env.KEY_HASH!,
  },
  session: {
    dailyLimitUSD: 100,
    perTransactionLimitUSD: 25,
    expiryHours: 24,
    allowedChains: [10004],
  },
});

General-purpose runtime (@veridex/agents)

import { createAgent, tool } from '@veridex/agents';
import { z } from 'zod';
 
const searchDocs = tool({
  name: 'search_docs',
  description: 'Search internal documentation by keyword',
  input: z.object({ query: z.string() }),
  safetyClass: 'read',
  async execute({ input }) {
    return {
      success: true,
      llmOutput: `Would search docs for ${input.query}`,
    };
  },
});
 
const agent = createAgent({
  id: 'docs-agent',
  name: 'Docs Agent',
  model: { provider: 'openai', model: 'gpt-4o-mini' },
  instructions: 'Help users find accurate documentation quickly.',
  tools: [searchDocs],
});

Stacks Integration

// For Stacks-specific operations
import { createSDK, StacksClient } from '@veridex/sdk';
 
const sdk = createSDK('stacks', { network: 'testnet' });

Verify Installation

Core SDK

// test-sdk.ts
import { createSDK, getChainConfig, getSupportedChains } from '@veridex/sdk';
 
const sdk = createSDK('base', { network: 'testnet' });
const chains = getSupportedChains('testnet');
 
console.log('SDK initialized successfully!');
console.log('Supported chains:', chains);
console.log('Base config:', getChainConfig('base', 'testnet'));

Agent SDK

// test-agent.ts
import { createAgentWallet, PythOracle } from '@veridex/agentic-payments';
 
// Test Pyth oracle
const oracle = new PythOracle();
const ethPrice = await oracle.getPrice('ETH');
const stxPrice = await oracle.getPrice('STX');
 
console.log('Agent SDK loaded successfully!');
console.log('ETH price:', ethPrice);
console.log('STX price:', stxPrice);

Run with:

npx tsx test-sdk.ts

Next Steps