Skip to main content

Overview

The Have I Been Drained HTML widget allows you to embed a ready-to-use wallet security checker into your website with minimal configuration. The widget features a captcha-like interface that users can interact with to check their wallet security. Widget Loading State

Installation

Basic Setup

Add the widget script to your HTML page:

Configuration Options

Basic Configuration

Advanced Configuration

Configuration Reference

Callback Function

The onResult callback receives a result object:
Example:

Widget States

The widget displays different states based on the verification status:
  • Idle: Initial state with “Check wallet security” button
  • Loading: Shows spinner while analyzing the wallet
  • Verified: Shows result status (safe/at_risk/drained) with option to see detailed results
  • Error: Shows error message if verification fails
Users can click “See Results” to view a detailed modal with:
  • Risk score
  • Detections (if any)
  • Recommendations
  • Affected assets information

Styling

The widget is self-contained with its own styles. The widget container has a maximum width of 320px and is centered by default. All styles are scoped to the .hibd-widget class to avoid conflicts with your site’s CSS.

Custom Container Styling

You can style the container element:

Examples

React Integration

Vue Integration

WordPress Integration

Add to your theme’s functions.php:
Add to your template:

Advanced Usage

Multiple Widgets

You can have multiple widgets on the same page:

Custom API Endpoint

Use a custom API endpoint (for development):

Troubleshooting

  • Check that the script URL is correct
  • Verify the container element exists
  • Check browser console for errors
  • Ensure JavaScript is enabled
  • Check CSS class names
  • Verify container ID is correct
  • Ensure no conflicting styles
  • Try different theme option
  • Verify API URL is correct
  • Check network connectivity
  • Review browser console for errors
  • Test API endpoint directly

Best Practices

  1. Load script asynchronously - Don’t block page load
  2. Handle errors gracefully - Show user-friendly messages
  3. Respect user privacy - Don’t track addresses
  4. Customize styling - Match your site’s design
  5. Test thoroughly - Test on different browsers

Support

API Documentation

Learn about the API.

Contact Support

Get help with widget integration.