Skip to main content

Embedding the plugin

The VTO plugin is a web application that runs inside an iframe on your page. It loads your project's catalog and theme, runs the camera and applies makeup. It talks to your page through the JavaScript SDK.

Basic embed​

<iframe
src="https://plugin.pulpoar.com/vto/<project-key>"
allow="camera *;"
style="border: none; width: 1200px; height: 720px;"
></iframe>
AttributeRequiredDescription
srcYesYour plugin URL. See Project and slug identifiers.
allow="camera *;"YesLets the plugin use the camera. Without it, live camera and take-photo don't work.
Width and heightYesControls whether the UI renders in desktop, tablet or mobile layout. See Layout and dimensions.
HTTPS required

Browsers only allow camera access on secure (HTTPS) pages. The camera won't work on a page served over HTTP. localhost is the only exception during development.

Project key​

The plugin loads your project by its identifier. You can use either:

  • Slug: a readable, unique name you choose when the project is created. If it's changed, URLs that use the old slug stop working.
  • UUID: generated automatically and never changes.
https://plugin.pulpoar.com/vto/<slug>
https://plugin.pulpoar.com/vto/<uuid>

Both give the same result. See Identifiers for the slugs of brands, categories, products, variants and looks.

Allowed Origins

Your website's domain must be in the project's Allowed Origins list in Studio. See Projects.

Opening on a specific item​

Add a path after the project key to open the plugin on a specific category, brand, product, variant or look:

https://plugin.pulpoar.com/vto/<project-key>/category/<slug>
https://plugin.pulpoar.com/vto/<project-key>/brand/<slug>
https://plugin.pulpoar.com/vto/<project-key>/product/<slug>
https://plugin.pulpoar.com/vto/<project-key>/variant/<slug>
https://plugin.pulpoar.com/vto/<project-key>/look/<id>

For example, the product detail page pattern uses the /product/<slug> path.

Adding the SDK​

Load the SDK on the same page to listen to events and send actions:

<iframe src="https://plugin.pulpoar.com/vto/<project-key>" allow="camera *;"></iframe>

<script src="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js"></script>
<script>
pulpoar.onReady((project) => console.log('VTO ready', project));

pulpoar.onAddToCart((variants) => {
// Add the selected variants to your cart
});
</script>

See JavaScript SDK for all installation options.

Go to Product​

In a browser, the plugin opens a variant's link automatically when the user clicks Go to Product. In a mobile WebView it can't route inside your app, so listen to the onGoToProduct event and open the product page yourself.

Next steps​