Official TypeScript/JavaScript SDK for Bloque platform.
⚠️ Development NoticeThis SDK is currently under active development. Breaking changes may occur between versions. We strongly recommend pinning to a specific version in your
package.jsonto avoid unexpected issues.{ "dependencies": { "@bloque/sdk": "x.x.x" } }Replace
x.x.xwith the latest version from npm.
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
This monorepo contains the following packages:
- @bloque/sdk - Main SDK package for Bloque platform integration
- @bloque/sdk-core - Core utilities, HTTP client, and shared types
- @bloque/sdk-orgs - Organizations API client
- @bloque/sdk-compliance - Compliance and KYC verification API client
- @bloque/sdk-accounts - Accounts and virtual cards API client
- @bloque/sdk-identity - Identity and aliases API client
bun add @bloque/sdkimport { 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.
- 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)
# Install dependencies
bun install
# Build all packages
bun run build
# Clean all packages
bun run cleanbun run build- Build all packages in the correct orderbun run clean- Clean all package builds and node_modulesbun run changeset- Create a new changeset for versioningbun run version- Apply changesets and version packagesbun run publish- Publish packages to npm
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 checkContributions are welcome! Please ensure all tests pass and code quality checks are satisfied before submitting a PR.
Copyright (c) 2025-present Bloque Copilot Inc.