Skip to content

Instantly share code, notes, and snippets.

@femmerling
Last active April 3, 2017 07:48
Show Gist options
  • Save femmerling/da8a17a3c9d440a6bb0d3cfab1564c02 to your computer and use it in GitHub Desktop.
Save femmerling/da8a17a3c9d440a6bb0d3cfab1564c02 to your computer and use it in GitHub Desktop.
Prism Widget Initialization Script
<div id="prism-widget"></div>
<script src="https://prismapp-files.s3.amazonaws.com/widget/prism.js"></script>
<script type="text/javascript">
(function(e, b, c) {
e.Shamu = {
merchant_id: '',
initialize: function(a) {
a.merchant_id ? this.merchant_id = a.merchant_id : console.log("Shamu: Please initialize Shamu with a merchat_id");
},
display: function() {
if (this.merchant_id) {
require('initialize');
} else console.log("Skyfish: You need to initialize Skyfish with a merchant_id")
}
}
})(window, document, "script");
</script>
<script type="text/javascript">
Shamu.initialize({'merchant_id': '<some_merchant_id>',});
Shamu.display();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment