Testing a Web SDK beta on a store
Before a Joryio web SDK version is released, it is published as a beta. Each beta is on the Joryio script host at its own versioned address, for example:
https://sdk.joryio.com/web/1.4.0-beta.4/joryio.min.js
A beta is never on the address your store loads normally (https://sdk.joryio.com/web/1/joryio.min.js), so no store gets it unless someone asks for it. The store plugins have a switch, for developers, that makes one test store load a beta. Use it on a test or staging store, not on a live shop.
What the switch does
- The storefront loads
joryio.min.jsfrom the address you set. - The web push service worker imports
joryio-sw.jsfrom the same folder. - The page editor and card feed files (
joryio-editor.min.js,joryio-cards-ui.min.js) come from the same folder too: the SDK loads them from the folder it was loaded from. - Only an address of the form
https://sdk.joryio.com/web/<version>/joryio.min.jsis accepted. Anything else is ignored and the standard SDK is loaded, so the switch can never point your store at another host. - The plugin's settings page says
Loading Joryio SDK from <address>while it is active, or that the value is ignored.
Your Content-Security-Policy needs nothing new: the beta is on the same host as the standard SDK.
WooCommerce and WordPress
Plugin 1.6.46 or later. Add this line to wp-config.php, above /* That's all, stop editing! */:
define('JORYIO_SDK_URL', 'https://sdk.joryio.com/web/1.4.0-beta.4/joryio.min.js');
If the site uses a page cache, empty it so cached pages pick up the new address. Remove the line to go back to the standard SDK.
Magento
Extension 1.4.34 or later. Add the value to app/etc/env.php, inside the returned array, then run bin/magento cache:flush (the snippet is in the full page cache):
'system' => [
'default' => [
'joryio' => ['developer' => ['sdk_url' => 'https://sdk.joryio.com/web/1.4.0-beta.4/joryio.min.js']],
],
],
The notice is under Stores > Configuration > Joryio > In-app messages and web push. There is no admin field for this on purpose. Remove the value and flush the cache to go back.
PrestaShop
Module 1.2.28 or later. Add this line to config/defines_custom.inc.php (create the file if it does not exist, starting with <?php):
define('JORYIO_SDK_URL', 'https://sdk.joryio.com/web/1.4.0-beta.4/joryio.min.js');
The notice is on the module's configuration page. Remove the line to go back; with web push on, save the module settings once afterwards so the service worker file is written again.
Shopify
Not available. The Joryio app embed is a set of files that Shopify serves for the app; a store cannot change them, and the app has no hidden setting for this. Test a beta on a WordPress, Magento or PrestaShop store, or on a page of your own that loads the beta address directly.
Your own site
Without a store plugin, put the beta address in your script tag instead of /web/1/, or install the npm beta (npm i @joryio/web-sdk@beta).