@sesamy/sesamy-js 1.0.1 → 1.0.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
@@ -14,11 +14,18 @@ The following events are tracked:
14
14
 
15
15
  ## API
16
16
 
17
+ ## Events
18
+
19
+ The following events are emitted by the sesamy-js library:
20
+
21
+ - `sesamyReady` - Emitted when the `sesamy-js` library is ready to be used
22
+ - `sesamyAuthenticated` - Emitted when the user is authenticated
23
+
17
24
  ## Usage
18
25
 
19
26
  The script can either be initiated with a JSON object in a script tag or by calling the init method.
20
27
 
21
- The script will look for a script tag with the id `sesamy-js`, and if it isn't found it will wait for a call to the init function before initializing.
28
+ The script will look for a script tag with the id `sesamy-js`, and if it isn't found it will wait for a call to the init function before initializing. The only required part is the `clientId` attribute.
22
29
 
23
30
  ```html
24
31
  <script type="application/json" id="sesamy-js">
@@ -28,7 +35,15 @@ The script will look for a script tag with the id `sesamy-js`, and if it isn't f
28
35
  </script>
29
36
  ```
30
37
 
31
- ## TODO
38
+ These are the available configuration options, with their default values:
32
39
 
33
- - We should consider replacing the saturated library as it keeps the messages in memory. We should maybe replace it with a library that stores the messages in local storage in case the user is offline.
34
- - Ensure that the client-id is fetched from the page or config
40
+ ```javascript
41
+ {
42
+ clientId: null,
43
+ namespace: 'sesamy',
44
+ analytics: {
45
+ enabled: true,
46
+ endpoint: 'https://logs.sesamy.com/events'
47
+ }
48
+ }
49
+ ```