wallet-connect-button-vue
| Install | |
|---|---|
npm install wallet-connect-button-vue |
|
| Latest Version: | 1.0.32 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 21, 2026 |
| Links: | GitHub · npm |
wallet-connect-button-vue
A Vue 3 component for NP Wallet integration.
Installation
npm install wallet-connect-button-vue
Usage
- Import the component in your Vue app:
import { WalletConnectButton } from 'wallet-connect-button-vue';
- Use the component in your template:
<template>
<WalletConnectButton
:service-id="'your-service-id'"
:api-key="'your-api-key'"
:wallet-connect-host="'https://wallet-connect.eu'"
:label="'Connect Wallet'"
@success="onWalletSuccess" />
</template>
- Handle the success event in your component:
<script setup>
const onWalletSuccess = (attributes: any) => {
console.log('Wallet connected successfully:', attributes);
}
</script>
API
Props
serviceId: string- The registration's identifier. NB Wallet Connect calls it a service id: one company registers a service per website or application.clientId: string- The original name for the same value, still fully supported. Give either one;serviceIdwins when both are set.
With the nbwallet attribute the button talks to NB Wallet Connect, which has renamed
this identifier throughout its API (service_id, /api/service/...). Every other
variant still calls its host with client_id. That switch is automatic; you only
choose which prop name to write.
apiKey?: string- Optional. API key for authenticationwalletConnectHost?: string- Optional. Custom wallet connect host URL (defaults to https://wallet-connect.eu)label?: string- Optional. Custom button text (defaults to 'Inloggen met NP Wallet')lang?: string- Optional. Language setting for the wallet button (defaults to 'nl')returnUrl?: string- Optional. Where the wallet app sends the user after a same-device disclosure; the verifier appendssession_tokento it. Defaults to the address of the page the button is on. Set it when the button lives in an iframe (see below).
Events
success- Emitted when wallet connection succeeds
Embedding in an iframe
Cross-device (QR code) works in an iframe as is. Same-device needs two things, because the wallet app returns the user to a page and the button inside the iframe cannot see the address of the page around it:
- Set
return-urlto the full address of the page that contains the iframe. - On that page, when it loads with
session_token(and, if present,nonce) in its query string, hand them to the iframe. Either append them to the iframe'ssrc, or post them in:
const params = new URLSearchParams(window.location.search);
const sessionToken = params.get("session_token");
if (sessionToken) {
const iframe = document.querySelector("iframe#wallet");
iframe.addEventListener("load", () => {
iframe.contentWindow.postMessage(
{ type: "wallet-connect-session", session_token: sessionToken, nonce: params.get("nonce") ?? undefined },
new URL(iframe.src).origin,
);
});
// Optional: drop the used token from the page's address so a reload doesn't retry it.
params.delete("session_token");
params.delete("nonce");
history.replaceState({}, "", `${location.pathname}${params.size ? `?${params}` : ""}`);
}
The button only accepts the message when it comes from the origin of return-url. It then
fetches the disclosed attributes and calls onSuccess inside the iframe, exactly as it does
when the token is in its own query string.
For further explanation and documentation, visit: https://wallet-connect.eu
Changes
1.0.32
- New
returnUrlprop: where the wallet returns the user after a same-device disclosure (defaults to the page's own address, as before). - The button accepts a
wallet-connect-sessionmessage with thesession_tokenfrom the page named byreturnUrl, so it works inside an iframe. See "Embedding in an iframe".
1.0.25
- Pass the
clientIdprop through to the embedded<nl-wallet-button>asclient-id, so the "No app yet?" link under the QR code becomes<help-base-url>?client_id=<clientId>(employee onboarding hand-off). - NB Wallet (
nbwallet) issuance deep links now use the https universal link basehttps://nbwallet.org/deeplink/...instead of the custombusinesswalletdebuginteraction://scheme. Business Wallet and NL Wallet links are unchanged.
Related Packages
Flexible component for Vue 2 that works for `<a>`, `<button>` and `<router-link>...
Vue library for integrating Algorand wallets into decentralized applications
Version History
| Version | Released | License |
|---|---|---|
| 1.0.32 | MIT | |
| 1.0.31 | MIT | |
| 1.0.30 | MIT | |
| 1.0.29 | MIT | |
| 1.0.28 | MIT | |
| 1.0.27 | MIT | |
| 1.0.26 | MIT | |
| 1.0.25 | MIT | |
| 1.0.24 | MIT | |
| 1.0.23 | MIT | |
| 1.0.22 | MIT | |
| 1.0.21 | MIT | |
| 1.0.20 | MIT | |
| 1.0.19 | MIT | |
| 1.0.18 | MIT | |
| 1.0.17 | MIT | |
| 1.0.16 | MIT | |
| 1.0.15 | MIT | |
| 1.0.14 | MIT | |
| 1.0.13 | MIT | |
| 1.0.12 | MIT | |
| 1.0.11 | MIT | |
| 1.0.10 | MIT | |
| 1.0.9 | MIT | |
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT |