miso-shopify-js-sdk
v0.2.4
Published
Miso JS SDK for Shopify integration
Downloads
3
Readme
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/[email protected]?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/[email protected]?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_view
in product page and article page.category_page_view
in collection page.add_to_cart
in all pages.remove_from_cart
in 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 .env
Dev Requirement
Setup git commit template by
git config commit.template .gitmessage
Setup pre-push hook to check commit log, run linter, and unit test.
ln -s ../../pre-push .git/hooks/pre-push
Use
Default
template for merge request