Skip to content

bloque-app/sdk

Repository files navigation

Bloque SDK

Official TypeScript/JavaScript SDK for Bloque platform.

⚠️ Development Notice

This SDK is currently under active development. Breaking changes may occur between versions. We strongly recommend pinning to a specific version in your package.json to avoid unexpected issues.

{
  "dependencies": {
    "@bloque/sdk": "x.x.x"
  }
}

Replace x.x.x with the latest version from npm.

Platform Support

This SDK is compatible with multiple JavaScript runtimes:

  • Node.js 22.x or higher
  • Bun 1.x or higher
  • Deno Latest version
  • Web/Browsers Modern browsers with ES2020+ support

Use Bloque with AI Agents

One command. Then just ask your agent.

npx @bloque/cli setup

After setup, talk to your agent naturally:

  • "Create a card for food expenses, load it with $200"
  • "I need a $25 disposable card for this website"
  • "Show me my balances"
  • "Top up my account with 100,000 COP from my bank"

Supports Cursor, Claude Desktop, Claude Code, and Antigravity on macOS, Linux, and Windows.

See the full CLI docs at packages/cli.

Packages

This monorepo contains the following packages:

Package Description
@bloque/sdk Main SDK — aggregates all packages
@bloque/sdk-core Core utilities, HTTP client, and shared types
@bloque/sdk-accounts Accounts, cards, Polygon, and transfers
@bloque/sdk-orgs Organizations API
@bloque/sdk-compliance KYC verification and compliance
@bloque/sdk-identity Identity and aliases
@bloque/cli CLI + MCP server for AI agents

Installation

For AI agents (recommended)

npx @bloque/cli setup

For programmatic use

npm install @bloque/sdk
# or
bun add @bloque/sdk

Quick Start

With AI Agents

Run npx @bloque/cli setup, restart your agent, and start asking. No code needed.

With Code

import { SDK } from '@bloque/sdk';

const bloque = new SDK({
  origin: 'your-origin',
  auth: {
    type: 'apiKey',
    apiKey: process.env.BLOQUE_API_KEY!,
  },
  mode: 'production',
});

const session = await bloque.connect('user-alias');

// Create a virtual card
const card = await session.accounts.card.create({
  urn: 'did:bloque:your-origin:user-alias',
  name: 'My Virtual Card',
});

console.log('Card created:', card.urn);
console.log('Last four digits:', card.lastFour);

// Create a Polygon wallet
const wallet = await session.accounts.polygon.create({
  metadata: { purpose: 'web3-transactions' },
});

console.log('Polygon wallet created:', wallet.address);

For detailed SDK documentation, see the @bloque/sdk package README.

Development

Prerequisites

  • One of the supported runtimes: Node.js 22.x+, Bun 1.x+, Deno, or modern browsers
  • TypeScript 5.x or higher (optional, for TypeScript projects)

Setup

# Install dependencies
bun install

# Build all packages
bun run build

# Clean all packages
bun run clean

Available Scripts

  • bun run build - Build all packages in the correct order
  • bun run clean - Clean all package builds and node_modules
  • bun run changeset - Create a new changeset for versioning
  • bun run version - Apply changesets and version packages
  • bun run publish - Publish packages to npm

Package Development

Each package has its own development scripts:

# Navigate to a package
cd packages/sdk

# Build the package
bun run build

# Watch mode for development
bun run dev

# Type check
bun run typecheck

# Code quality checks
bun run check

Contributing

Contributions are welcome! Please ensure all tests pass and code quality checks are satisfied before submitting a PR.

License

MIT

Copyright (c) 2025-present Bloque Copilot Inc.

Links