Embed SDK
Put a form on any site with one script tag, inline, as a popup, a slider or full page, with events and a small JavaScript API.

<button data-mitome-popup="2kdhncnx">Tell us what you think</button>
<script src="https://<your Mitome>/embed.js" async></script>The Share tab gives you this snippet for each mode with your form's slug filled in.
Modes
| Mode | Markup | Shows |
|---|---|---|
| Inline | <div data-mitome-form="SLUG" style="height:600px"></div> | Inside your page (600 px tall if you don't set a height) |
| Full page | <div data-mitome-form="SLUG" data-mitome-fullpage></div> | The whole window |
| Popup | <button data-mitome-popup="SLUG">…</button> | A centred panel, 760 × 680 (full screen on phones) |
| Slider | <button data-mitome-slider="SLUG">…</button> | A 520 px panel from the right |

Popups and sliders close with the ×, Esc or a click outside. If someone closes one while their answer is still being sent, they're asked first.
Attributes
| Attribute | Does |
|---|---|
data-mitome-hidden="ref=launch,team=growth" | Fills the form's hidden fields |
data-mitome-auto-close="3000" | Popup or slider: closes 3 s after the answer is recorded on Midnight |
Events
Each fires on the element and bubbles to window as a CustomEvent whose detail is { slug }:
| Event | When |
|---|---|
mitome:ready | The form loaded |
mitome:started | The person started |
mitome:submitted | They sent their answer |
mitome:recorded | It's recorded on Midnight |
mitome:close | A popup or slider closed |
Events never carry the answer, the receipt or anything about the person, and the frame doesn't resize itself to follow what they type: your page learns that someone answered, nothing more.
JavaScript API
Mitome.open('2kdhncnx', { mode: 'slider', autoClose: 3000 })
Mitome.close()
Mitome.on('recorded', ({ slug }) => showThanks())
Mitome.scan() // pick up elements added after the page loadedHow it stays private
The form runs in an iframe on Mitome's address, so your page can't read what people type, and their sealed answer and proof are made inside it. No special headers are needed on your site. An embedded form waits for the first tap before it loads Midnight, so visitors who scroll past download none of Midnight's code or keys.
If an ending redirects, the embed asks your page to go there (http and https links only). The person's own copy of their answer key lives in the frame, so they delete their answer from the thank-you screen there.
Browsers keep storage separate per site, so on a form without checks one browser can answer once per site the form is embedded on. Forms with checks take one answer per checked passport, email, account or wallet, wherever they're embedded.