The editor
Put the Meishi editor on your page, set it up and listen to its events.
Add it to your page
Works on plain HTML, WordPress, Shopify and Wix:
<script src="https://meishi.cards/creator/v1.js" defer></script>
<meishi-creator website-key="mk_live_xxx" height="720"></meishi-creator>
<script>
document.querySelector('meishi-creator').addEventListener('meishi-complete', event => {
console.log(event.detail.experienceId, event.detail.scanUrl);
});
</script>Options
Prop
Type
On the element, the same options are attributes: website-key, locale, content="video,model,info", print-width-mm, metadata (JSON), primary-color and height.
Events
| Event | When | Payload |
|---|---|---|
ready | The editor is loaded. | |
step | The visitor moved to another step. | { step } |
complete | The visitor sent the design. | { experienceId, scanUrl, status, printImageUrl } |
processed | The hologram or model is finished. | { experienceId, status, scanUrl } |
error | Something went wrong. | { message, code? } |
On the element they arrive as meishi-ready, meishi-step, meishi-complete, meishi-processed and meishi-error, with the payload in event.detail.
complete comes from the visitor's browser, so treat it as a hint, not as proof. Your server
confirms and follows experiences with the server key.
Error codes
error.code says why, when the API did. A shop can hide its hologram option on any of these instead of showing the editor's message.
| Code | Meaning |
|---|---|
website_not_allowed | This page's address is not listed on the key. |
key_inactive | The key was deleted. |
plan_required | Your plan does not include the website integration. |
no_experience_credits | Your organization has no experiences left. |
session_expired | The editor was open too long. Open it again. |
session_quota | Too many editor sessions were started. Try again later. |