@sesamy/sesamy-js 1.18.1 → 1.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,8 @@ The analytics module is used to track events and page views. It is using the [Ge
11
11
  The following events are tracked:
12
12
 
13
13
  - Page views, with events triggered on router updates
14
+ - Scroll events, with events triggered on scroll at 25%, 50%, 75%, and 100%
15
+ - Active and idle duration
14
16
 
15
17
  ## API
16
18
 
@@ -74,7 +76,9 @@ The following events are emitted by the sesamy-js library:
74
76
  - `sesamyJsLogout` - Emitted when the user logs out
75
77
  - `sesamyJsPurchase` - Emitted after a purchase is completed and passes an itemSrc property with the source of the purchase
76
78
 
77
- # Query parameters
79
+ # Url triggers
80
+
81
+ ## Query parameters
78
82
 
79
83
  The library can trigger actions based on query parameters. The following query parameters are supported:
80
84
 
@@ -83,6 +87,10 @@ The library can trigger actions based on query parameters. The following query p
83
87
  - `sesamy-login`. If present, the library will validate that the user is authenticated. If not, the user will be logged out and a new login with be initiated.
84
88
  - `sesamy-purchase`. Triggers a sesamyJsPurchase event.
85
89
 
90
+ # Hash triggers
91
+
92
+ The library can read the access token from the hash. It is not the preferred way of logging in a user but can be used when redirecting the user across domains where a cookie-based solution is not possible. The hash is not sent to the server so the is no risk of leaking the token. The token hash is passed like this: `#access_token=<token>`
93
+
86
94
  ## Usage
87
95
 
88
96
  The script can either be initiated with a JSON object in a script tag or by calling the init method.
@@ -653,6 +661,14 @@ To use the transform module, include the configuration in your initialization sc
653
661
 
654
662
  This configuration will replace the content of the element with the ID `example`, remove elements with the class `ad-banner`, insert the content of the element with the ID `source-element` into elements with the class `insert-content`, and load content from a URL into elements with the class `load-from-url`.
655
663
 
664
+ ### Polyfils
665
+
666
+ The library polyfills the following methods for compatibility with older browsers:
667
+
668
+ - URL
669
+ - URLSearchParams
670
+ - fetch
671
+
656
672
  ### Notes
657
673
 
658
674
  - The `content` property is required for 'insert' and 'replace' transforms.