npm install mellowtel-elements
import { MellowtelElements } from 'mellowtel-elements'; // Initialize with your extension ID and config key const mellowtel = new MellowtelElements('your-extension-id', 'your-config-key'); // Create elements await mellowtel.createElement('opt-in-container', { type: 'opt-in' }); await mellowtel.createElement('opt-out-container', { type: 'opt-out' }); await mellowtel.createElement('settings-container', { type: 'settings' });
<!DOCTYPE html> <html> <head> <title>MellowTel Elements Example</title> </head> <body> <!-- Container divs for elements --> <div id="opt-in-container"></div> <div id="opt-out-container"></div> <div id="settings-container"></div> <!-- Load from CDN --> <script src="https://cdn.jsdelivr.net/npm/mellowtel-elements@latest/dist/index.global.js"></script> <script> // Initialize MellowTel Elements const mellowtel = new window.MellowtelElements.default('your-extension-id', 'your-config-key'); // Create elements mellowtel.createElement('opt-in-container', { type: 'opt-in' }); mellowtel.createElement('opt-out-container', { type: 'opt-out' }); mellowtel.createElement('settings-container', { type: 'settings' }); </script> </body> </html>