Quick start
Easiest way to integrate Metamap into your page is to use Metamap button.
Import scripts
Add following script to your page.
<script src="https://web-button.metamap.com/button.js"></script>
Add button
Add Metamap button to your page.
<metamap-button
clientid="your_client_id"
flowId="your_flow_id"
/>
Replace your_client_id
and your_flow_id
with ids from your dashboard.
How do I obtain client and flow id?
Add callback listeners
const metamapButton = document.querySelector('metamap-button');
metamapButton.addEventListener('metamap:userFinishedSdk', ({ detail }) => {
console.log('finished payload', detail)
});
metamapButton.addEventListener('metamap:exitedSdk', ({ detail }) => {
console.log('exited payload', detail)
});
const metamapButton = document.querySelector('metamap-butto');
metamapButton.addEventListener('metamap:userFinishedSdk', ({ detail }) => {
console.log('finished payload', detail)
});
metamapButton.addEventListener('metamap:exitedSdk', ({ detail }) => {
console.log('exited payload', detail)
});
Updated 3 months ago