How to embed a 3D packaging editor in your own website
Paste a <div> and two script lines into the page; the editor loads in an iframe that only your registered domains may show. When a customer sends a design, your page receives the mockup, the print file and the dieline, the order lands in your Drint orders and Drint calls your webhook, signed with your key’s secret. It needs a Drint API plan — Starter $49, Business $199 or Scale $599 a month (a year is billed as 10 months); Business can be tried free for 14 days on your own domain, no card.
Steps
- Make an embed key. In Drint: Account → Sign-in & security → Embed keys. List your domains; add
localhost:PORTto try it on your machine first. - Paste the embed. Put the code below where the editor should be. Options:
mockup(open one model),sizein mm,lang,customerdetails,artworkto start from. - Handle the result.
onDone(result)gives the mockup picture, the print file, the dieline and the size; the same arrives at your webhook (design.completed, headerX-Drint-Signature).
<div id="drint"></div>
<script src="https://drint.io/embed.js"></script>
<script>
Drint.open({ el: '#drint', key: 'dre_…', lang: 'en' });
</script>
What to know
- Works with any site builder that accepts HTML
- The frame only opens on your domains (Content-Security-Policy frame-ancestors)
- File links in the result last 24 hours
- Full reference: drint.io/developers#embed
Questions
Is the key secret?
No — it sits in your page. What it may do is bound to the domains you list: the editor will not open, and results are not accepted, anywhere else.
How tall is the editor?
680 px by default; pass height to change it. It takes the full width of its element.