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

  1. Make an embed key. In Drint: Account → Sign-in & security → Embed keys. List your domains; add localhost:PORT to try it on your machine first.
  2. Paste the embed. Put the code below where the editor should be. Options: mockup (open one model), size in mm, lang, customer details, artwork to start from.
  3. 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, header X-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

See the editor livePlans and 14-day free trial

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.

Related

add a 3D box designer to a Shopify print storeadd a 3D box designer to a WooCommerce print shopA mockup API for print-on-demand and packagingA dieline API: FEFCO and ECMA dielines at any sizeDrint API reference