Skip to main content

iFrame Widget

Raze can be embedded as an iframe in your application, allowing you to control wallet whitelisting and receive real-time trading data programmatically.

Basic Setup

TypeScript Setup

API Reference

Commands (Sent to Iframe)

Add wallets to the whitelist for tracking.
Example:

Responses (Received from Iframe)

object
Sent when iframe is loaded and ready for communication.
object
Confirms wallets were added successfully.
object
Real-time trading statistics for whitelisted addresses.
object
Individual trade data from whitelisted addresses.
object
Real-time token price updates from all trading activity.

Complete Integration Example

TypeScript Class

React Hook

Security Considerations

Origin Validation

Always validate the origin of messages in production:

Content Security Policy

Add CSP headers to allow iframe embedding:

Input Validation

Validate wallet addresses before sending:

Customization

Theme Customization

Create custom themes by editing CSS variables:

Whitelabel Setup

  1. Update brand.json with your branding
  2. Replace src/logo.png with your logo
  3. Create a custom CSS theme
  4. Run npm run generate-html
  5. Build and deploy

Full Customization Guide

See all customization options

Best Practices

1

Wait for Ready Signal

Always wait for IFRAME_READY before sending commands
2

Queue Messages

Queue messages if iframe isn’t ready yet
3

Validate Input

Validate wallet addresses before sending
4

Handle Timeouts

Implement timeouts for async operations
5

Error Handling

Always handle potential errors and edge cases