Error: {error.title || 'An error occurred'}
)}${error.details}
`; errorDiv.style.display = 'block'; }; window.addEventListener('onEntriClose', (event) => { if (event.detail.error) { showError(event.detail.error); } }); ``` ### Check Domain Before Opening Use `checkDomain` to verify provider support before showing the modal: ```javascript theme={null} const connectDomain = async (domain) => { const config = { applicationId: 'YOUR_APPLICATION_ID', token: 'YOUR_JWT_TOKEN', dnsRecords: [ { type: 'CNAME', host: 'www', value: 'your-service.com', ttl: 300 } ], }; // Check if automatic setup is supported const check = await window.entri.checkDomain(domain, config); if (check.setupType === 'Automatic') { console.log('Automatic setup available with', check.provider); } else { console.log('Manual setup required'); } // Open Entri with prefilled domain config.prefilledDomain = domain; window.entri.showEntri(config); }; ``` ### Multiple DNS Records Configure multiple records for complex setups: ```javascript theme={null} window.entri.showEntri({ applicationId: 'YOUR_APPLICATION_ID', token: 'YOUR_JWT_TOKEN', dnsRecords: [ { type: 'CNAME', host: 'www', value: 'your-service.com', ttl: 300, }, { type: 'TXT', host: '@', value: 'v=spf1 include:your-service.com ~all', ttl: 300, }, { type: 'MX', host: '@', value: 'mail.your-service.com', ttl: 300, priority: 10, }, ], }); ``` ## Troubleshooting ### Event listeners not firing Make sure you're adding listeners **before** calling `showEntri()`: ```javascript theme={null} // Wrong - listener added after showEntri window.entri.showEntri(config); window.addEventListener('onEntriClose', handler); // Too late! // Correct - listener added before showEntri window.addEventListener('onEntriClose', handler); window.entri.showEntri(config); ``` ### SDK not loaded Check that the script has loaded before using it: ```javascript theme={null} if (typeof window.entri === 'undefined') { console.error('Entri SDK not loaded'); return; } window.entri.showEntri(config); ``` Or wait for the script to load: ```javascript theme={null} window.addEventListener('load', () => { // Safe to use window.entri here document.getElementById('connect-btn').addEventListener('click', () => { window.entri.showEntri(config); }); }); ``` ### Multiple event handlers firing If you're dynamically adding/removing elements, make sure to clean up event listeners: ```javascript theme={null} const handler = (event) => { console.log('Entri closed:', event.detail); }; // Add listener window.addEventListener('onEntriClose', handler); // Remove listener when no longer needed window.removeEventListener('onEntriClose', handler); ``` ## Next Steps * [API Reference](/connect/configuration#entrishowentriconfig) - Full configuration options * [Webhooks](/webhooks-overview) - Server-side event handling * [Getting Started](/getting-started) - Dashboard setup and token generation # Monitor Configuration Source: https://developers.entri.com/monitor/configuration showEntri() config keys for Monitor: top-level monitor: true and per-record monitor: true. ## Adding monitoring using Entri Connect When initializing a new domain using Entri Connect, you can pass a `monitor: true` property in either the domain object or each record object to specify that it should be tracked with Entri Monitor. Monitor everything: ```json theme={null} { "prefilledDomain": "mydomain123.com", "applicationId": "12345", "token": "12345", "monitor": true, "dnsRecords": [ { "type": "CNAME", "host": "{SUBDOMAIN}.xyz.example.com", // blog.xyz.example.com "value": "custom-proxy.leadpages.net", "ttl": 300, }, { "type": "TXT", "host": "@", "value": "{SLD}-{TLD}", // example-com "ttl": 300, } ] } ``` Monitor only the CNAME record: ```json theme={null} { "prefilledDomain": "mydomain123.com", "applicationId": "12345", "token": "12345", "dnsRecords": [ { "type": "CNAME", "host": "{SUBDOMAIN}.xyz.example.com", // blog.xyz.example.com "value": "custom-proxy.leadpages.net", "ttl": 300, "monitor":true }, { "type": "TXT", "host": "@", "value": "{SLD}-{TLD}", // example-com "ttl": 300, } ] } ``` # Monitor Endpoints Source: https://developers.entri.com/monitor/endpoints REST endpoints for Entri Monitor: /monitor/domains, /monitor/domains/batch, /monitor/health, /monitor/status. ## Entri Monitor API ## General API Guidelines ### Base URL ``` https://api.goentri.com ``` ### Authentication All requests require the following headers: * **`applicationId`**: Your unique application ID. * **`Authorization`**: A bearer token generated using your client secret. **Example Headers**: ```http theme={null} applicationId: your-app-id Authorization: Bearer your-auth-token ```