Installation
The Bloque SDK is available as an npm package and can be installed using any modern JavaScript package manager.Package Managers
Requirements
Runtime Support
The SDK supports multiple JavaScript runtimes:- Node.js 22.x or higher
- Bun 1.x or higher
- Deno Latest version
- Browsers Modern browsers with ES2020+ support
- React Native Latest stable version
The SDK uses modern JavaScript features and requires ES2020+ support.
TypeScript
While the SDK is written in TypeScript and includes full type definitions, TypeScript is optional for your project:- TypeScript 5.x or higher (recommended)
- Type definitions are included automatically
- Full IntelliSense support in VS Code and other editors
Monorepo Packages
The Bloque SDK is a monorepo containing multiple packages. The main@bloque/sdk package aggregates all functionality, but you can also install individual packages if needed:
- @bloque/sdk - Main SDK package (recommended)
- @bloque/sdk-core - Core utilities and HTTP client
- @bloque/sdk-accounts - Accounts and virtual cards API
- @bloque/sdk-identity - Identity and aliases API
- @bloque/sdk-compliance - Compliance and KYC verification API
- @bloque/sdk-orgs - Organizations API
For most use cases, install only
@bloque/sdk. The individual packages are primarily for advanced modular setups.Version Pinning
In yourpackage.json:
package.json
^0.0.43 or ~0.0.43 during the pre-1.0 phase.
Verifying Installation
After installation, verify the SDK is working:Platform-Specific Setup
Node.js
No additional setup required. Node.js 22+ automatically loads.env files.
Bun
Bun automatically loads.env files without additional configuration:
Deno
Use npm specifiers or import maps:Browser
For browser environments, use JWT authentication instead of API keys:React Native
Install the SDK and configure secure token storage:Build Output
The SDK ships with multiple module formats:- ESM (ES Modules):
dist/index.js- For modern bundlers and Node.js - CommonJS:
dist/index.cjs- For legacy Node.js require() - TypeScript Declarations:
dist/index.d.ts- Full type definitions
Modern bundlers like Vite, Webpack 5+, and esbuild will automatically use the ESM version.
Troubleshooting
Module not found error
Module not found error
Make sure you’ve installed the package:If using TypeScript, verify your
tsconfig.json has "moduleResolution": "bundler" or "node16".Type errors with TypeScript
Type errors with TypeScript
Ensure you’re using TypeScript 5.x or higher:
Runtime version errors
Runtime version errors
Verify your Node.js version:Upgrade if needed:
Cannot find module '@bloque/sdk'
Cannot find module '@bloque/sdk'
This usually happens when:
- The package wasn’t installed correctly
- Your
node_modulesfolder is corrupted
Next Steps
Quickstart
Get started with your first API call
Authentication
Learn about API keys and JWT authentication