npm.io
1.1.18 • Published 4d ago

wallet-connect-button-react

Licence
MIT
Version
1.1.18
Deps
0
Size
2.6 MB
Vulns
0
Weekly
0

wallet-connect-button-react

A React component for NL Wallet integration.

Installation

npm install wallet-connect-button-react

Usage

  1. Import the component in your React app:
import { WalletConnectButton } from 'wallet-connect-button-react';
  1. Use the component in your JSX:
<WalletConnectButton 
  clientId="your-client-id"
  apiKey="your-api-key"
  walletConnectHost="https://wallet-connect.eu"
  onSuccess={(attributes) => console.log('Success:', attributes)}
>
  Connect Wallet
</WalletConnectButton>
  1. Handle the success callback in your component:
const handleWalletSuccess = (attributes: any) => {
  console.log('Wallet connected successfully:', attributes);
};

API

Props
  • clientId: string - Required. Your client ID for wallet connection
  • onSuccess: (attributes: AttributeData | undefined) => void - Required. Callback function called when wallet connection succeeds
  • apiKey?: string - Optional. API key for authentication
  • walletConnectHost?: string - Optional. Custom wallet connect host URL (defaults to https://wallet-connect.eu)
  • children?: React.ReactNode - Optional. Custom button content

For further explanation and documentation, visit: https://wallet-connect.eu

Keywords