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

Packages

This monorepo contains the following packages:

Installation

bun add @bloque/sdk

Quick Start

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

const bloque = new SDK({
  origin: 'your-origin', // Required: your origin identifier
  auth: {
    type: 'apiKey',
    apiKey: process.env.BLOQUE_API_KEY!,
  },
  mode: 'production', // or 'sandbox'
  platform: 'node', // optional: 'node' | 'bun' | 'deno'
});

// Connect to a user session
const userSession = await bloque.connect('did:bloque:your-origin:user-alias');

// Create a virtual card
const card = await userSession.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);

For detailed 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