{"info":{"_postman_id":"e6b30238-4fa0-4866-856f-904382331597","name":"Web Push JS","description":"<html><head></head><body><p>This document describes how to integrate Symplify Web Push on your web site.</p>\n<h1 id=\"what-is-it-and-what-can-i-use-it-for\">What is it and what can I use it for?</h1>\n<p>Symplify Web Push messaging enables you to Pop Up when your customer is on site.\nYou can for example use Symplify Web Push to inform selected customers that they have an active offer available, tips and tricks within the platform or showcasing features based on the recipient profile.</p>\n<p>You can of course personalize all messages and use the different Symplify modules, like Journeys and Campaigns to generate your Symplify Web Push messages.</p>\n<ul>\n<li>Create welcome messages for new users with link and instructions for navigating the app or best use the application</li>\n<li>Send a reminder that pops up after login so they remember to complete their registration with credit card, loyalty card and shipping address etc.</li>\n<li>Showcase new features and encourage users to try them out</li>\n<li>Send coupons and offers</li>\n<li>Remind customers of abandoned carts or loyalty credits on their accounts</li>\n<li>Offer order tracking after sales</li>\n</ul>\n<h1 id=\"include-the-symplify-web-push-resources\">Include the Symplify Web Push resources</h1>\n<p>Please note: Depending on which Symplify server you are using, you will need to use one of these distributions to allow the Web Push script to communicate with the correct server:</p>\n<p>European servers:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://d3mi6d1ao3fzsg.cloudfront.net/webpush\n</code></pre><p>North American servers:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://d2v4xhvyfyhzvd.cloudfront.net/webpush\n</code></pre><p>Reach out to your Success manager if you are uncertain.</p>\n<p><em>The examples below are using the European CDN.</em></p>\n<h3 id=\"stylesheet\">Stylesheet</h3>\n<p>The Symplify Web Push stylesheet contains the default look and feel of the inbox and pop ups. You can customize the inbox by overriding the default styles using your own stylesheet.\nThe stylesheet is usually inserted in the <code>&lt;head&gt;</code> element of your page.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;link\n    rel=\"stylesheet\"\n    type=\"text/css\"\n    href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.css\"\n/&gt;\n</code></pre>\n<h3 id=\"script\">Script</h3>\n<p>The Symplify Web Push script is responsible for displaying symplify web push messages as they arrive, as well as providing an optional inbox where received messages are listed with their respective read or unread status. The Symplify Web Push editor can customize where and how the message should be displayed.</p>\n<p>The script is usually inserted immediately before the closing <code>&lt;/body&gt;</code> element of your page.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script\n    id=\"sym-web-push\"\n    src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n    type=\"text/javascript\"\n    data-inbox-element=\"#my-inbox-element\"\n    data-user-hash=\"[server side generated user hash, see 'How to identify the recipient']\"\n    async\n&gt;&lt;/script&gt;\n</code></pre>\n<h1 id=\"how-to-identify-the-recipient\">How to identify the recipient</h1>\n<p>We need a secret identifier that is used when connecting to the Symplify Web Push service.\nThe secret is a securely hashed signature created by calling our REST API with the id of your contact. If the contact is present in any of your lists in Symplify, we will return a hash which you can use to connect to the contact's inbox.</p>\n<p>NOTE: Since communicating with our REST API is done on the server side, this will require some development on your side. <a href=\"https://help.symplify.com/hc/en-us/articles/360011076720-API-overview\">Read about using our API here</a></p>\n<p>A basic usage pattern is:</p>\n<ul>\n<li>The user logs in to your site.</li>\n<li>Once you know the id of your user, call our user hash resource.</li>\n<li>Cache the user hash in your web server session storage or in your database.<ul>\n<li>Do not call the user hash resource for every page.</li>\n<li>User hashes are valid for 90 days.</li>\n</ul>\n</li>\n<li>Include the script on pages where Symplify Web Push messages should be displayed.</li>\n</ul>\n<p>Secure user hashes are generated using the REST resource <code>/webpush</code>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /rest/{customerid}/webpush\n{\n  \"contactId\": \"the id of the user in your database\", (originalId in Symplify)\n  \"privacyLevel\": \"SENSITIVE|NOT_SENSITIVE\" (defaults to SENSITIVE)\n}\n</code></pre><p>An example response would look like</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"userHash\": \"e94187765acfe001e415107c68f6a6fd5e74b66042145fe28609787b2e881b67\"\n}\n</code></pre><h1 id=\"push-notifications\">Push Notifications</h1>\n<p><em>WIP - This text is under development and subject to change</em></p>\n<p>Symplify Web Push is embedded in your pages, and is using regular HTML elements and javascript to show notifications. This, however, depends on the user being logged in and viewing your web site. While this is sufficient for most communcation, you might also want to draw attention to important updates to users tha are not actively browsing your web site.</p>\n<p>Push notifications behave a little differently compared to our script, since it is managed by the operating system and/or web browser your users are using.</p>\n<p>The user must opt-in through the browsers built-in dialog to allow your web site to display push notifications. In addition to allowing the web site to show notifications, the user must also have enabled notifications in their computer settings. If the user clicks \"Block\" in the built-in dialog to not allow your native notifications there is no way to ask again. The user must then go in to the browser settings and remove the block for your web site.</p>\n<p>Make sure you ask for permission to send push notifications a time when the user is most likely to understand why you want to show notifications, and what they will receive.</p>\n<p>We will try to follow the guidelines for a good UX from (<a href=\"https://developers.google.com/web/fundamentals/push-notifications/permission-ux\">https://developers.google.com/web/fundamentals/push-notifications/permission-ux</a>)</p>\n<ul>\n<li>We will not show a push notification permission dialog by default when the page is loaded.</li>\n<li>A toggle for native notifications is added to the inbox, or you can implement your own custom UI. The built-in permissions dialog is shown when the toggle/button is clicked.</li>\n</ul>\n<p>The push notification Service Worker script must be hosted at the same origin (Protocol + Domain name + Port) as the web site where you want to show notifications. Each sub-domain is considered a different origin.</p>\n<p><em>(for test, this is <a href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/snapshot/service-worker.js\">https://d3mi6d1ao3fzsg.cloudfront.net/webpush/snapshot/service-worker.js</a>)</em></p>\n<p>You need to download <code>https://d3mi6d1ao3fzsg.cloudfront.net/webpush/service-worker.min.js</code> and serve it from your own web site.</p>\n<p>You will not get automatic updates for this script, please make manual updates regularly.</p>\n<p><em><a href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/version.json\">https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/version.json</a> displays the version of the latest release</em></p>\n<p>Add these attributes to the web push script tag to enable push notifications:</p>\n<ul>\n<li><code>data-notifications=\"true\"</code> - default is <code>false</code></li>\n<li><code>data-service-worker=\"scripts/service-worker.min.js\"</code> - path to the downloaded service worker script. default is <code>service-worker.min.js</code></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\"> &lt;script\n            type=\"application/javascript\"\n             src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n            data-inbox-type=\"toggle\"\n            data-count-method=\"unread\"\n            data-enable-api=\"true\"\n            data-notifications=\"true\"\n            data-service-worker=\"scripts/service-worker.min.js\"\n            async\n        &gt;\n</code></pre>\n<h3 id=\"built-in-push-notification-management\">Built in Push Notification management</h3>\n<p>Add a checkbox with <code>data-toggles=\"push:notifications\"</code> to the Inbox header or footer (View examples in the <a href=\"#inbox-header-and-footer\">Inbox Header and Footer</a> section).</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;input type=\"checkbox\" data-toggles=\"push:notifications\" /&gt;\n</code></pre>\n<p>Or use our prestyled markup in the Inbox header or footer.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div class=\"sym-input-toggle\"&gt;\n    &lt;label class=\"sym-input-switch\"&gt;\n        &lt;input type=\"checkbox\" id=\"push-notifications\" data-toggles=\"push:notifications\"&gt;\n        &lt;div class=\"sym-input-slider\"&gt;&lt;/div&gt;\n    &lt;/label&gt;\n    &lt;label for=\"push-notifications\"&gt;Push notifications&lt;/span&gt;\n&lt;/div&gt;\n</code></pre>\n<p><img src=\"inbox-notifications.png\" alt=\"inbox-notifications\"></p>\n<h3 id=\"custom-push-notification-management\">Custom Push Notification management</h3>\n<p>Note: You need to enable the client side API via <code>data-enable-api=\"true\"</code> as described earlier.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;a onclick=\"Symplify.WebPush.subscribeToPush()\"&gt;Enable Push Notifications&lt;/a&gt;\n&lt;a onclick=\"Symplify.WebPush.unsubscribeFromPush()\"\n    &gt;Disable Push Notifications&lt;/a\n&gt;\n</code></pre>\n<p>Native notifications will <strong>not</strong> be shown when:</p>\n<ul>\n<li>A user is viewing your web site. (Note: It's not possible to know if the user is currently visiting a page where Symplify Web Push UI is running).</li>\n<li>A user has not allowed native notifications via the built in notification management in their operating system (MacOS, Windows, *nix, Android, IOS etc).</li>\n<li>A user has not allowed native notifications for you web site via the built in notification management in their web browser.</li>\n</ul>\n<h1 id=\"privacy-levels\">Privacy Levels</h1>\n<p><em>NOTE: This section is only relevant if you cannot retrieve the user hash on the server side</em></p>\n<p>Symplify Web Push provides two similiar types of identifiers for the user for which messages should be displayed. They are both equally secure but one can be generated automatically when a user clicks on a link in a message sent by Symplify, and the other must be requested from Symplify by your server and inserted on the page programmatically.</p>\n<p><em>The difference is in the control over which of your pages the user can receive Symplify Web Push messages.</em></p>\n<p>The two types of user hashes are:</p>\n<ul>\n<li><code>NOT_SENSITIVE</code><ul>\n<li>Added as a querystring parameter to each link that is clicked in a Symplify message.</li>\n<li>Stored in a cookie in the users' browser. (and readable by inspecting browser cookies)</li>\n<li>Readable over HTTP.</li>\n<li>Readable in browser history.</li>\n</ul>\n</li>\n<li><code>SENSITIVE</code><ul>\n<li>Generated by the Symplify API.</li>\n<li>Injected programmatically when rendering each page.</li>\n<li>Only readable by inspecting the rendered page, disappears when the page is closed.</li>\n</ul>\n</li>\n</ul>\n<p>Using only a cookie, Symplify can never know if your users are viewing a page while logged in, or if the user has logged out (and possibly left the computer for others to use). The cookie is stored for the entire domain, including subdomains. <em>ie</em> <a href=\"http://www.example.com\">www.example.com</a>, shop.example.com, userarea.example.com.</p>\n<p>By using the user hash generated on the server side, you can insert it on pages where you <strong>know</strong> the user is logged in - and no identification that can be found later by a rogue agent will be stored on the users' computer.</p>\n<p>By default, all Symplify Web Push messages are sent with PrivacyLevel.Sensitive.</p>\n<p>This means that these messages will only be shown if the page use a secure user hash generated by the REST resource.</p>\n<h1 id=\"inbox-header-and-footer\">Inbox Header and Footer</h1>\n<p>Include a script tag with your own markup to get a custom Inbox header and/or footer.</p>\n<p>These must have the ids <code>sym-inbox-header</code> and <code>sym-inbox-footer</code> respectively.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script id=\"sym-inbox-header\" type=\"text/html\"&gt;\n    &lt;strong&gt;Messages&lt;/strong&gt;\n    &lt;img class=\"profile-picture\" src=\"profile-12345.png\" /&gt;\n&lt;/script&gt;\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script id=\"sym-inbox-footer\" type=\"text/html\"&gt;\n    &lt;div class=\"sym-input-toggle\"&gt;\n        &lt;label class=\"sym-input-switch\"&gt;\n            &lt;input type=\"checkbox\" id=\"push-notifications\" data-toggles=\"push:notifications\"&gt;\n            &lt;div class=\"sym-input-slider\"&gt;&lt;/div&gt;\n        &lt;/label&gt;\n        &lt;label for=\"push-notifications\"&gt;Push notifications&lt;/span&gt;\n    &lt;/div&gt;\n&lt;/script&gt;\n</code></pre>\n<h1 id=\"inbox-list-item-template\">Inbox List Item Template</h1>\n<p>Include a script tag with the id <code>sym-inbox-list-item</code> with your own markup to customize how the inbox displays each message.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script id=\"sym-inbox-list-item\" type=\"text/html\"&gt;\n    &lt;li class=\"sym-msg\"&gt;\n        &lt;span class=\"sym-msg-text\"&gt;&lt;/span&gt;\n        &lt;span class=\"sym-msg-delete\"&gt;&lt;/span&gt;\n    &lt;/li&gt;\n&lt;/script&gt;\n</code></pre>\n<h1 id=\"inbox-configuration\">Inbox Configuration</h1>\n<p>If you want to display the inbox in a specific location or implement your own UI for the inbox, you can tell the Symplify Web Push script where and how to list the user's messages.</p>\n<p>You can also enable a client side API, which you can use to display pop ups to users without using the Symplify Web Push service. This can be useful when the user browse pages without being logged in.</p>\n<p>Some optional settings require basic HTML and/or javascript knowledge.</p>\n<h4 id=\"minimal-options\">Minimal options</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script\n    type=\"text/javascript\"\n    id=\"sym-webpush\"\n    data-secure-hash=\"e94187765acfe001e415107c68f6a6fd5e74b66042145fe28609787b2e881b67\"\n&gt;&lt;/script&gt;\n</code></pre>\n<h4 id=\"all-options\">All options</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script\n    type=\"text/javascript\"\n    id=\"sym-webpush\"\n    data-secure-hash=\"e94187765acfe001e415107c68f6a6fd5e74b66042145fe28609787b2e881b67\"\n    data-inbox-element=\"#my-inbox\"\n    data-inbox-type=\"badge\"\n    data-inbox-header=\"#my-inbox-header\"\n    data-inbox-footer=\"#my-inbox-footer\"\n    data-notifications=\"true\"\n    data-inbox-list-element=\"#my-inbox-messages\"\n    data-count-method=\"unread\"\n    data-get-latest-message=\"true\"\n    data-enable-api=\"true\"\n    data-autostart=\"false\"\n    data-notifications=\"true\"\n    data-worker-script=\"scripts/worker-script.js\"\n&gt;&lt;/script&gt;\n</code></pre>\n<p>Options may also be passed using the global variable <code>window.SymWebPush</code>.\nWhen using this method you get the variable name by removing \"data-\" and convert the remainder to camelCase.\ni.e. <code>data-inbox-type</code> becomes <code>inboxType</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;script type=\"text/javascript\"&gt;\n    window.SymWebPush = {\n        inboxElement: '#sym-inbox',\n        secureHash: '[server side generated user hash]',\n    };\n&lt;/script&gt;\n&lt;script\n    id=\"sym-web-push\"\n    src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n    type=\"text/javascript\"\n    async\n&gt;&lt;/script&gt;\n</code></pre>\n<h3 id=\"available-options\">Available options</h3>\n<h4 id=\"data-secure-hash-required\">data-secure-hash (required)</h4>\n<p>The secure hash for the current user.</p>\n<ul>\n<li><code>data-secure-hash=\"e94187765acfe001e415107c68f6a6fd5e74b66042145fe28609787b2e881b67\"</code></li>\n</ul>\n<h4 id=\"data-inbox-element-optional\">data-inbox-element (optional)</h4>\n<p>Selector for the element which should be used to insert the inbox on the page. If you do not specify an inbox element, no UI except for the popups that pop up when a new message arrive will be displayed. This element is also used as a toggle for the inbox dropdown.</p>\n<ul>\n<li><code>data-inbox-element=\"#my-inbox\"</code></li>\n</ul>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector\">Query Selector documentation on MDN web docs </a> (external link)</p>\n<h4 id=\"data-inbox-type-optional\">data-inbox-type (optional)</h4>\n<p>Symplify Web Push provides a few different ways to display the user's number of unread messages. Add an element with a <code>sym-inbox-count</code> class inside your custom inbox element, or use our \"badge\" type to display a small badge with a counter.</p>\n<ul>\n<li><code>data-inbox-type=\"badge\"</code></li>\n</ul>\n<p>Read more about our inbox types and their options <a href=\"#inbox-types\">here</a>.</p>\n<h4 id=\"data-inbox-list-element-optional\">data-inbox-list-element (optional)</h4>\n<p>Selector for the element which should be used to list the inbox on the page.</p>\n<ul>\n<li><code>data-inbox-list-element=\"#my-inbox-messages\"</code></li>\n</ul>\n\n\n<h4 id=\"data-count-method-optional\">data-count-method (optional)</h4>\n<p>Enables you to postpone the initialization of the Symplify Web Push functionality. Useful if your inbox element is rendered after the document is loaded.\nYou need to enable the client side API to start the functionality at a later time.</p>\n<ul>\n<li><code>data-count-method=\"top\"</code> - default is <code>all</code></li>\n</ul>\n<h4 id=\"data-get-latest-message-optional\">data-get-latest-message (optional)</h4>\n<p>If this is set to true, the Symplify Web Push script will automatically fetch the latest message and show it if it is unread.</p>\n<ul>\n<li><code>data-get-latest-message=\"true\"</code> - default is <code>false</code></li>\n</ul>\n<h4 id=\"data-autostart-optional\">data-autostart (optional)</h4>\n<p>Enables you to postpone the initialization of the Symplify Web Push functionality. Useful in Single Page Applications or if your inbox element is rendered after the document is loaded.\nYou need to enable the client side API to start the functionality at a later time.</p>\n<ul>\n<li><code>data-autostart=\"false\"</code> - default is <code>true</code></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">Symplify.WebPush.start();\n</code></pre>\n<h4 id=\"data-enable-api-optional\">data-enable-api (optional)</h4>\n<p>Enables a simple client side API which you can use to display pop ups similar to the ones sent via the Symplify Web Push service.</p>\n<ul>\n<li><code>data-enable-api=\"true\"</code> - default is <code>false</code></li>\n</ul>\n<p>You can use the API to show a pop up by using the <code>Symplify.WebPush.show</code> function.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">Symplify.WebPush.show(\n    'Become a member today!',\n    '[pop up content]',\n    'BOTTOM_RIGHT'\n);\n</code></pre>\n<p>Use the <code>Symplify.WebPush.start</code> function to start the Web Push functionality when <code>data-autostart=\"false\"</code>. You can provide options that was not available on page render.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">myApiCall().then(function (userHash) {\n    Symplify.WebPush.start({\n        secureHash: userHash,\n        inboxElement: '#my-inbox-element',\n    });\n});\n</code></pre>\n<p>Use the <code>Symplify.WebPush.stop</code> function to disable Web Push functionality and stop listening for Web Push Messages.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">logout().then(function () {\n    Symplify.WebPush.stop();\n});\n</code></pre>\n<h1 id=\"inbox-types\">Inbox Types</h1>\n<p>If you do not want to create your own UI for the Symplify Web Push inbox, you can use one of the types provided out of the box.</p>\n<p>Provided types are:</p>\n<h4 id=\"default\">default</h4>\n<p><img src=\"custom.png\" alt=\"default\"></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div id=\"sym-inbox\"&gt;Messages (&lt;span class=\"sym-inbox-count\"&gt;1&lt;/span&gt;)&lt;/div&gt;\n</code></pre>\n<p>No markup is automatically inserted for the inbox count indicator.\nThe script will look for an element with the class <code>sym-inbox-count</code> inside the element selected by data-inbox-element and set the text to the user's number of unread messages.</p>\n<h4 id=\"toggle\">toggle</h4>\n<p><img src=\"toggle.png\" alt=\"toggle\"></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div id=\"sym-inbox\"&gt;&lt;/div&gt;\n</code></pre>\n<h4 id=\"badge\">badge</h4>\n<p><img src=\"badge.png\" alt=\"badge\"></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div id=\"sym-inbox\"&gt;&lt;svg&gt;&lt;/svg&gt;&lt;/div&gt;\n</code></pre>\n<p>Icon is not included, the badge is positioned with an offset relative to the last element in your inbox element</p>\n<h4 id=\"badgeinline\">badgeInline</h4>\n<p><img src=\"badge-inline.png\" alt=\"badgeInline\"></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div id=\"sym-inbox\"&gt;Notications&lt;/div&gt;\n</code></pre>\n<p>Text is not included, the badge is positioned relative to the last element in your inbox element</p>\n<h4 id=\"badge-bell-badge-horn\">badge-bell, badge-horn</h4>\n<p><img src=\"badge-bell.png\" alt=\"badge-bell\"></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;div id=\"sym-inbox\"&gt;&lt;/div&gt;\n</code></pre>\n<p>Icon is included.</p>\n<h1 id=\"example-page-1\">Example page 1</h1>\n<p>A page with push notifications and an inbox with a header and footer.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;head&gt;\n        &lt;link\n            rel=\"stylesheet\"\n            type=\"text/css\"\n            href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.css\"\n        /&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;div id=\"sym-inbox\"&gt;&lt;/div&gt;\n\n        &lt;script id=\"sym-inbox-header\" type=\"text/html\"&gt;\n            &lt;strong&gt;Messages&lt;/strong&gt;\n            &lt;span class=\"profile-pic\"&gt;&lt;/span&gt;\n        &lt;/script&gt;\n\n        &lt;script id=\"sym-inbox-footer\" type=\"text/html\"&gt;\n            &lt;div class=\"sym-input-toggle\"&gt;\n                &lt;label class=\"sym-input-switch\"&gt;\n                    &lt;input type=\"checkbox\" id=\"push-notifications\" data-toggles=\"push:notifications\"&gt;\n                    &lt;div class=\"sym-input-slider\"&gt;&lt;/div&gt;\n                &lt;/label&gt;\n                &lt;label for=\"push-notifications\"&gt;Push notifications&lt;/span&gt;\n            &lt;/div&gt;\n        &lt;/script&gt;\n\n        &lt;script\n            type=\"application/javascript\"\n            src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n            data-secure-hash=\"3179e184a6f9e3g6fbd2d1b12ae2dfd0bd01ba340dd153d4163d692554f8c11e\"\n            data-inbox-type=\"toggle\"\n            data-enable-api=\"true\"\n            data-notifications=\"true\"\n            data-service-worker=\"scripts/service-worker.min.js\"\n            async\n        &gt;&lt;/script&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<h1 id=\"example-page-2\">Example page 2</h1>\n<p>A page without an Inbox. If you're using the NOT_SENSITIVE option where the user hash is sent in the page URL, remove the <code>data-secure-hash</code> attribute as well.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;head&gt;\n        &lt;link\n            rel=\"stylesheet\"\n            type=\"text/css\"\n            href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.css\"\n        /&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;script\n            type=\"application/javascript\"\n            src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n            data-secure-hash=\"3179e184a6f9e3g6fbd2d1b12ae2dfd0bd01ba340dd153d4163d692554f8c11e\"\n            async\n        &gt;&lt;/script&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<h1 id=\"example-page-3\">Example page 3</h1>\n<p>A page with push notifications and no Inbox. If you're using the NOT_SENSITIVE option where the user hash is sent in the page URL, remove the <code>data-secure-hash</code> attribute as well.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;head&gt;\n        &lt;link\n            rel=\"stylesheet\"\n            type=\"text/css\"\n            href=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.css\"\n        /&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;a onclick=\"Symplify.WebPush.subscribeToPush()\"\n            &gt;Enable Push Notifications&lt;/a\n        &gt;\n        &lt;br /&gt;\n        &lt;a onclick=\"Symplify.WebPush.unsubscribeFromPush()\"\n            &gt;Disable Push Notifications&lt;/a\n        &gt;\n\n        &lt;script\n            type=\"application/javascript\"\n            src=\"https://d3mi6d1ao3fzsg.cloudfront.net/webpush/1/webpush.min.js\"\n            data-secure-hash=\"3179e184a6f9e3g6fbd2d1b12ae2dfd0bd01ba340dd153d4163d692554f8c11e\"\n            data-enable-api=\"true\"\n            data-notifications=\"true\"\n            data-service-worker=\"scripts/service-worker.min.js\"\n            async\n        &gt;&lt;/script&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"What is it and what can I use it for?","slug":"what-is-it-and-what-can-i-use-it-for"},{"content":"Include the Symplify Web Push resources","slug":"include-the-symplify-web-push-resources"},{"content":"How to identify the recipient","slug":"how-to-identify-the-recipient"},{"content":"Push Notifications","slug":"push-notifications"},{"content":"Privacy Levels","slug":"privacy-levels"},{"content":"Inbox Header and Footer","slug":"inbox-header-and-footer"},{"content":"Inbox List Item Template","slug":"inbox-list-item-template"},{"content":"Inbox Configuration","slug":"inbox-configuration"},{"content":"Inbox Types","slug":"inbox-types"},{"content":"Example page 1","slug":"example-page-1"},{"content":"Example page 2","slug":"example-page-2"},{"content":"Example page 3","slug":"example-page-3"}],"owner":"6437984","collectionId":"e6b30238-4fa0-4866-856f-904382331597","publishedId":"TW6uqA8w","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-01-26T10:09:32.000Z"},"item":[],"event":[{"listen":"prerequest","script":{"id":"8c73c26c-8fbc-4c18-bd3d-4beec9bd8c82","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"63ae6707-e563-439e-8564-7bd8366fb89c","type":"text/javascript","exec":[""]}}]}