Nimiq Hub
The secure wallet integration API that lets your users sign transactions, manage accounts, and interact with the blockchain — without you ever touching their private keys.
Get started now
Request a payment and get the signed transaction.
pnpm add @nimiq/hub-api
npm install @nimiq/hub-api
yarn add @nimiq/hub-api
<script src="https://cdn.jsdelivr.net/npm/@nimiq/hub-api@latest/dist/standalone/HubApi.standalone.umd.js"></script>
import HubApi from '@nimiq/hub-api'
const hubApi = new HubApi('https://hub.nimiq.com')
const result = await hubApi.checkout({
appName: 'My Shop',
recipient: 'NQ07 0000 0000 0000 0000 0000 0000 0000 0000',
value: 1_000, // 0.01 NIM in Luna
})
console.log('Payment complete:', result.hash)
import HubApi from '@nimiq/hub-api'
const hubApi = new HubApi('https://hub.nimiq.com')
const result = await hubApi.signMessage({
appName: 'My App',
message: 'Sign in to My App',
})
console.log('Signed by:', result.signer)
// Verify signature on your server
import HubApi from '@nimiq/hub-api'
const hubApi = new HubApi('https://hub.nimiq.com')
const result = await hubApi.chooseAddress({
appName: 'My App',
})
console.log('Address:', result.address)
console.log('Label:', result.label)
Why Use Hub API
Secure Wallet Integration Made Simple
The Hub provides a unified interface for all Nimiq wallet operations. Your users maintain full control of their keys while you get a simple, powerful API.
Zero Key Management
Private keys never leave the secure Keyguard environment
Trusted by Users
Same interface across all Nimiq apps
Multi-Chain Ready
Support for Nimiq today; Bitcoin and Polygon flows require a privileged Hub origin
Simple Integration
CDN or NPM — start in minutes
Type-Safe API
Full TypeScript definitions included
Mobile Friendly
Popup or redirect flows for all devices
How the Hub Architecture Works — Learn about the Hub-Keyguard relationship, request behaviors, and security model.
Need Lower-Level Control? — For advanced use cases requiring direct blockchain access, consider using the Web Client or RPC API.
Hub Capabilities
Flexible integration options. Choose your integration style, access powerful methods, and support multiple chains.
Security First
The Hub uses a separate secure origin (Keyguard) to store and manage private keys. Your application never has access to user keys — all signing happens in the isolated Keyguard environment.
Choose your integration style
Select how the Hub appears to your users.
Request behaviour
Popup (Default)
Opens in a centered popup window
Redirect
Full-page redirect for mobile-friendly flows
IFrame
Seamless integration for privileged origins
Core Methods
Payments
Accept NIM with checkout() and signTransaction()
Authentication
Sign messages for secure user login with signMessage()
Cashlinks
Create shareable payment links with createCashlink()
Multi-Chain Support
Bitcoin
Sign Bitcoin transactions with signBtcTransaction()
Polygon
Sign EVM transactions with signPolygonTransaction()
Atomic Swaps
Trustless cross-chain trading with setupSwap()