JavaScript Widget Documentation
Installation
<script src="https://walver.io/static/js/walver-auth.js"></script>Initialization
// Optional: Set the base URL (useful for development environments)
window.walverBaseUrl = 'https://walver.io'; // Default value if not specified
// Initialize the authentication widget
WalverAuth.init({
buttonText: 'Login with Walver.io', // Optional: Custom button text
buttonClass: 'walver-auth-button', // Optional: Custom button class
width: '360px', // Optional: Width of the iframe
height: '480px', // Optional: Height of the iframe
serviceName: 'Your Application Name', // Recommended: Your service name
container: '#my-auth-container', // Required: Container element or selector
onSuccess: function(data) {
// Handle successful authentication
console.log('Authentication successful:', data);
// data contains: walletAddress, signature, message, chain, nonce, verifiedDomain
},
onError: function(error) {
// Handle authentication error
console.error('Authentication error:', error);
},
onCancel: function() {
// Handle authentication cancellation
console.log('Authentication cancelled');
}
});Configuration Options
Option
Type
Required
Default
Description
Authentication Response
Security Features
Example Integration
Advanced Usage
Custom Button Styling
Server-side Verification
Troubleshooting
Widget Not Appearing
Authentication Failures
Last updated