The loader at entri-latest.js is immutable, so the integrity hash above stays valid across Entri SDK releases — no need to update it on each version.Because the loader fetches the SDK asynchronously, window.entri isn’t available immediately. Wait for the entri:ready event before calling showEntri():
function onEntriReady(cb) { if (window.entri) return cb(window.entri); window.addEventListener("entri:ready", () => cb(window.entri), { once: true });}onEntriReady((entri) => { entri.showEntri(/* …config… */);});
For security, fetch the JWT on your server-side. The token expires after 60 minutes.
Never expose your secret in client-side code. Always fetch the JWT from your backend.
fetch('https://api.goentri.com/token', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ applicationId: "YOUR_APP_ID", // From the dashboard secret: "YOUR_SECRET" // From the dashboard }),}).then(response => response.json()).then(data => { console.log('Token:', data.auth_token); // Save this token to use in step 4}).catch(error => console.error('Error:', error));