tryora-venia-plugin
v0.1.1
Published
Venia auto-integration plugin for Tryora embeds.
Maintainers
Readme
tryora-venia-plugin
Venia plugin that auto-wires Tryora embeds through PWA Studio intercepts.
What you get after install
/styler-pageroute (Tryora page-view embed)- PDP script injection via
ProductFullDetail - PDP carousel VTO embed via
ProductImageCarousel - Catalog VTO embed via
Gallery data-vto-product-id={item.sku}on catalog image links
Install
yarn add tryora-venia-plugin tryora-embed-core
# or
npm i tryora-venia-plugin tryora-embed-coreConsumer configuration (Venia app)
Add this to your storefront package.json:
{
"pwa-studio": {
"targets": {
"intercept": "./local-intercept.js"
}
}
}Your local intercept can stay empty. It just needs to exist so Buildpack runs intercept collection from dependencies.
local-intercept.js:
module.exports = targets => targets;Configure Tryora backend/store
Configure before rendering app UI (for example in your storefront entry file):
import { configureTryoraEmbed } from 'tryora-embed-core';
configureTryoraEmbed({
storeId: 'YOUR_STORE_ID',
backendOrigin: 'https://your-tryora-host.example'
});Alternative options:
- set
globalThis.__TRYORA_EMBED_CONFIG__ = { storeId, backendOrigin } - use
TRYORA_STORE_IDandTRYORA_BACKEND_ORIGINenv variables
Build and run
After install/update:
yarn buildImportant
- If you already have custom Tryora patching in your local intercept, remove it to avoid duplicate script injections.
