miso-shopify-js-sdk v0.2.4
Miso Shopify JS SDK
This library integrates Miso's personalization service into Shopify with minimum engineering effort. For how personalization works in Miso, please visit documentation site.
This SDK provides the following Miso services:
- Auto-collect user interaction using interaction API, so to train personalization model.
Usage
This SDK is installed & enable automatically once Shopify integration is setup via Dojo, the web dashboard for Miso.
Install manually using script tag:
<script src="https://cdn.jsdelivr.net/npm/miso-shopify-js-sdk@0.1.0?api_key=YOUR_MISO_PUBLISHABLE_KEY"></script>Note that SDK will not started if api_key is missing. The api_key can also be specified during runtime:
<script src="https://cdn.jsdelivr.net/npm/miso-shopify-js-sdk@0.1.0?api_key=YOUR_MISO_PUBLISHABLE_KEY"></script>
<script>
misoSDK.init({ apiKey: 'yourMisoPublishableKey' })
</script>Technical Detail
Interaction collection
Miso Shopify JS SDK parse Shopify page and find important interaction signal at best. As theme of each Shopify store differ, the SDK might failed to catch interaction in some cases. Please report an issue if you find this happens.
The SDK supports capturing the following interaction:
product_detail_page_viewin product page and article page.category_page_viewin collection page.add_to_cartin all pages.remove_from_cartin all pages.
For detail usage of each interactions, please visit Miso API document.
Developer How-to
System Requirements
- Node 12
Environment Variable
Create .env file from env.sample, and webpack will pick variable in .env automatically.
cp env.sample .envDev Requirement
Setup git commit template by
git config commit.template .gitmessageSetup pre-push hook to check commit log, run linter, and unit test.
ln -s ../../pre-push .git/hooks/pre-pushUse
Defaulttemplate for merge request