@atomic.io/action-cards-web-sdk-cdn-icons 25.1.0 → 25.2.0
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 +28 -43
- package/package.json +1 -1
- package/public/LICENSES.txt +19 -19
- package/public/iframe-manager.js +3 -3
- package/public/sdk.d.ts +18 -9
- package/public/sdk.js +3 -3
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[](https://codecov.io/github/atomic-app/action-cards-web-sdk)
|
|
2
2
|
|
|
3
|
-
# Web SDK - Current (25.
|
|
3
|
+
# Web SDK - Current (25.2.0)
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
7
7
|
The Atomic Web SDK allows you to integrate an Atomic stream container into your web app or site, presenting cards from a stream to your customers.
|
|
8
8
|
|
|
9
|
-
The current stable release is **25.
|
|
9
|
+
The current stable release is **25.2.0**.
|
|
10
10
|
|
|
11
11
|
### Browser support
|
|
12
12
|
|
|
@@ -18,10 +18,10 @@ We currently do not have a boilerplate app for the Web SDK. [Contact us](mailto:
|
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
The current version of the Atomic Web SDK is `25.
|
|
21
|
+
The current version of the Atomic Web SDK is `25.2.0`, and is hosted on our CDN at `https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js`.
|
|
22
22
|
|
|
23
23
|
As of version `24.2.1` the Web SDK also offers a bundle variant which does not include the font used for icons in action cards. Instead this font is fetched via CDN as required, allowing the size of your initial bundle loaded by the browser to be smaller. Both variations function identically in all other respects.
|
|
24
|
-
This variant is hosted on our CDN at `https://downloads.atomic.io/web-sdk/release/25.
|
|
24
|
+
This variant is hosted on our CDN at `https://downloads.atomic.io/web-sdk/release/25.2.0/sdk-cdn-icons.js`.
|
|
25
25
|
|
|
26
26
|
To integrate it, add the script for your chosen variant as a source to your web page:
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ To integrate it, add the script for your chosen variant as a source to your web
|
|
|
29
29
|
<html>
|
|
30
30
|
...
|
|
31
31
|
<body>
|
|
32
|
-
<script src="https://downloads.atomic.io/web-sdk/release/25.
|
|
32
|
+
<script src="https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js"></script>
|
|
33
33
|
</body>
|
|
34
34
|
</html>
|
|
35
35
|
```
|
|
@@ -93,21 +93,6 @@ AtomicSDK.setSessionDelegate(() => {
|
|
|
93
93
|
}, retryInterval)
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
#### JWT custom user ID field {#jwt-custom-user-id-field}
|
|
97
|
-
|
|
98
|
-
_(introduced in 25.1.0)_
|
|
99
|
-
|
|
100
|
-
To use a custom field in your JWT for the user ID used by the Atomic Platform you must first configure this field in the [Atomic Workbench](/sdks/auth-SDK#custom-user-id-field) for the relevant SDK API Key.
|
|
101
|
-
|
|
102
|
-
Once you have the API Key configuration in place, you need to call the `setTokenUserIdAttribute` method, supplying the field name:
|
|
103
|
-
|
|
104
|
-
```javascript
|
|
105
|
-
AtomicSDK.setTokenUserIdAttribute('custom_id_property')
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**info:**
|
|
109
|
-
This method must be called **before** initialization of the SDK
|
|
110
|
-
|
|
111
96
|
### Login convenience method
|
|
112
97
|
|
|
113
98
|
To be ready to display a stream container you need to have [initialised](https://documentation.atomic.io/sdks/web#displaying-a-stream-container) the SDK & set the [Session Delegate](https://documentation.atomic.io/sdks/web#authenticating-requests-with-a-jwt). You can use the convenience method `login` to accomplish this in one call. This method has the following parameters:
|
|
@@ -281,6 +266,7 @@ You can customize the following strings used by the Web SDK, using the `customSt
|
|
|
281
266
|
- The text displayed next to the option to indicate that a card was useful (`votingUsefulTitle`);
|
|
282
267
|
- The text displayed next to the option to indicate that a card was not useful (`votingNotUsefulTitle`);
|
|
283
268
|
- The title displayed at the top of the screen presented when a user indicates that a card was not useful (`votingFeedbackTitle`).
|
|
269
|
+
- The validation message shown to the user when they attempt to enter text feedback on a card exceeding the character limit (`votingFeedbackValidationMessage`).
|
|
284
270
|
- The error message shown when the user does not have an internet connection (`noInternetConnectionMessage`).
|
|
285
271
|
- The error message shown when the theme or card list cannot be loaded due to an API error (`dataLoadFailedMessage`).
|
|
286
272
|
- The title of the button allowing the user to retry the failed request for the card list or theme (`tryAgainTitle`).
|
|
@@ -298,6 +284,7 @@ If you don't provide these custom strings, the SDK defaults will be used:
|
|
|
298
284
|
- `votingUsefulTitle`: "This is useful"
|
|
299
285
|
- `votingNotUsefulTitle`: "This isn't useful"
|
|
300
286
|
- `votingFeedbackTitle`: "Send feedback"
|
|
287
|
+
- `votingFeedbackValidationMessage`: "Feedback is limited to 280 characters."
|
|
301
288
|
- `noInternetConnectionMessage`: "No internet connection"
|
|
302
289
|
- `dataLoadFailedMessage`: "Couldn't load data"
|
|
303
290
|
- `tryAgainTitle`: "Try again"
|
|
@@ -319,6 +306,7 @@ AtomicSDK.launch({
|
|
|
319
306
|
votingUsefulTitle: 'Positive feedback',
|
|
320
307
|
votingNotUsefulTitle: 'Negative feedback',
|
|
321
308
|
votingFeedbackTitle: 'Tell us more',
|
|
309
|
+
votingFeedbackValidationMessage: 'Feedback message is too long',
|
|
322
310
|
noInternetConnectionMessage: 'No internet connection available',
|
|
323
311
|
dataLoadFailedMessage: 'Failed to load cards',
|
|
324
312
|
tryAgainTitle: 'Please try again',
|
|
@@ -405,7 +393,7 @@ The code sample below shows how to use the `AtomicSDK.launch(config)` method, to
|
|
|
405
393
|
...
|
|
406
394
|
<body>
|
|
407
395
|
<!-- Installation -->
|
|
408
|
-
<script src="https://downloads.atomic.io/web-sdk/release/25.
|
|
396
|
+
<script src="https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js"></script>
|
|
409
397
|
|
|
410
398
|
<script>
|
|
411
399
|
AtomicSDK.initialise('<apiHost>', '<apiKey>', '<environmentId>')
|
|
@@ -480,7 +468,7 @@ The iframe generated by the `singleCard` method can be styled just like any othe
|
|
|
480
468
|
...
|
|
481
469
|
<body>
|
|
482
470
|
<!--Installation-->
|
|
483
|
-
<script src="https://downloads.atomic.io/web-sdk/release/25.
|
|
471
|
+
<script src="https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js"></script>
|
|
484
472
|
|
|
485
473
|
<script>
|
|
486
474
|
AtomicSDK.initialise('<apiHost>', '<apiKey>', '<environmentId>')
|
|
@@ -513,7 +501,7 @@ The iframe generated by the `embed` method can be styled just like any other DOM
|
|
|
513
501
|
...
|
|
514
502
|
<body>
|
|
515
503
|
<!--Installation-->
|
|
516
|
-
<script src="https://downloads.atomic.io/web-sdk/release/25.
|
|
504
|
+
<script src="https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js"></script>
|
|
517
505
|
|
|
518
506
|
<script>
|
|
519
507
|
AtomicSDK.initialise('<apiHost>', '<apiKey>', '<environmentId>')
|
|
@@ -1019,6 +1007,16 @@ If an expiry date is set on the card, you cannot select dates beyond this expiry
|
|
|
1019
1007
|
|
|
1020
1008
|
The Atomic SDKs support card voting, which allows you to gauge user sentiment towards the cards you send. When integrating the SDKs, you can choose to enable options for customers to indicate whether a card was useful to the user or not, accessible when they tap on the overflow button in the top right of a card.
|
|
1021
1009
|
|
|
1010
|
+
As of SDK version `25.2.0` SDK configuration of card voting has been deprecated, instead card voting should be configured from the workbench on a per card basis from the "Menu actions" options in the [Card elements menu](/guide/cards/creating#card-elements-menu-left).
|
|
1011
|
+
|
|
1012
|
+
Configuration of card voting from within the workbench provides further customization options, allowing you to specify whether or not text feedback is enabled for vote up or vote down actions.
|
|
1013
|
+
|
|
1014
|
+
Whether enabled in the workbench, or in the SDK configuration, the default wording of card voting options can be configured. See the [custom strings](#custom-strings) section of this guide if you want to change the default wording.
|
|
1015
|
+
|
|
1016
|
+
### Configuring card voting within the SDK
|
|
1017
|
+
|
|
1018
|
+
The following describes how card voting appears when configured via the SDK feature configuration:
|
|
1019
|
+
|
|
1022
1020
|
If the user indicates that the card was useful, a corresponding analytics event is sent for that card (`card-voted-up`).
|
|
1023
1021
|
|
|
1024
1022
|
If they indicate that the card was not useful, they are presented with a secondary screen where they can choose to provide further feedback. The available reasons for why a card wasn’t useful are:
|
|
@@ -1029,9 +1027,7 @@ If they indicate that the card was not useful, they are presented with a seconda
|
|
|
1029
1027
|
|
|
1030
1028
|
If they select "Something else", a free-form input is presented, where the user can provide additional feedback. The free form input is limited to 280 characters. After tapping "Submit", an analytics event containing this feedback is sent (`card-voted-down`).
|
|
1031
1029
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
Card voting is disabled by default. You can enable positive card voting ("This is useful"), negative card voting ("This isn’t useful"), or both:
|
|
1030
|
+
You can enable positive card voting ("This is useful"), negative card voting ("This isn’t useful"), or both:
|
|
1035
1031
|
|
|
1036
1032
|
```js
|
|
1037
1033
|
AtomicSDK.launch({
|
|
@@ -1346,8 +1342,9 @@ You will also need to update this token every time the logged-in user changes in
|
|
|
1346
1342
|
|
|
1347
1343
|
To deregister the device for Atomic notifications for your app, such as when a user completely logs out of your app, call `deregisterDeviceForNotifications` on `AtomicSDK`.
|
|
1348
1344
|
|
|
1349
|
-
|
|
1345
|
+
:::caution
|
|
1350
1346
|
Calling `AtomicSDK.logout()` will automatically invoke this method.
|
|
1347
|
+
:::
|
|
1351
1348
|
|
|
1352
1349
|
If the deregistration fails, the promise will be rejected, returning a description of the failure that occurred.
|
|
1353
1350
|
|
|
@@ -1848,10 +1845,10 @@ To use the SDK with your Cordova or Capacitor app:
|
|
|
1848
1845
|
|
|
1849
1846
|
1. Download the Atomic SDK from our CDN, and bundle it with your application. There are two files you need to download:
|
|
1850
1847
|
|
|
1851
|
-
- `https://downloads.atomic.io/web-sdk/release/25.
|
|
1852
|
-
- `https://downloads.atomic.io/web-sdk/release/25.
|
|
1848
|
+
- `https://downloads.atomic.io/web-sdk/release/25.2.0/iframe-manager.js`
|
|
1849
|
+
- `https://downloads.atomic.io/web-sdk/release/25.2.0/sdk.js`
|
|
1853
1850
|
|
|
1854
|
-
_Where `25.
|
|
1851
|
+
_Where `25.2.0` is the version number of the SDK you wish to use._
|
|
1855
1852
|
|
|
1856
1853
|
2. **(Cordova only)**: Modify the `Content-Security-Policy` meta tag in your Cordova app to allow the following URLs, after the `default-src` directive:
|
|
1857
1854
|
|
|
@@ -1936,21 +1933,9 @@ The following example sets the client app version to `Version 2.3.1`.
|
|
|
1936
1933
|
AtomicSDK.setClientAppVersion('Version 2.3.1')
|
|
1937
1934
|
```
|
|
1938
1935
|
|
|
1939
|
-
### Setting a custom user Id attribute
|
|
1940
|
-
|
|
1941
|
-
The SDK provides a method `AtomicSDK.setTokenUserIdAttribute` for determining a custom user Id attribute in your JWT if you are not using the standard `sub` attribute. This attribute must also be configured in the Atomic Workbench against the relevant SDK API key.
|
|
1942
|
-
|
|
1943
|
-
The attribute name has a maximum length of 128 characters and must be a string.
|
|
1944
|
-
|
|
1945
|
-
The following example sets the attribute to `my_custom_id`.
|
|
1946
|
-
|
|
1947
|
-
```js
|
|
1948
|
-
AtomicSDK.setTokenUserIdAttribute('my_custom_id')
|
|
1949
|
-
```
|
|
1950
|
-
|
|
1951
1936
|
## Third-party dependencies
|
|
1952
1937
|
|
|
1953
|
-
The Atomic Web SDK (as at the current release `25.
|
|
1938
|
+
The Atomic Web SDK (as at the current release `25.2.0`) uses the following third-party dependencies:
|
|
1954
1939
|
|
|
1955
1940
|
- Font Awesome Free `5.13.1`
|
|
1956
1941
|
- snarkdown `1.2.1`
|
package/package.json
CHANGED
package/public/LICENSES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The Atomic Web SDK (25.
|
|
1
|
+
The Atomic Web SDK (25.2.0) uses the following open sources libraries:
|
|
2
2
|
|
|
3
3
|
-----------------------
|
|
4
4
|
|
|
@@ -90,19 +90,19 @@ MIT License
|
|
|
90
90
|
|
|
91
91
|
Copyright (c) <year> <copyright holders>
|
|
92
92
|
|
|
93
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
94
|
-
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
95
|
-
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
96
|
-
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
94
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
95
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
96
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
97
97
|
following conditions:
|
|
98
98
|
|
|
99
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
99
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
100
100
|
portions of the Software.
|
|
101
101
|
|
|
102
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
103
|
-
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
104
|
-
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
105
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
102
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
103
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
104
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
105
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
106
106
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
107
107
|
|
|
108
108
|
|
|
@@ -145,19 +145,19 @@ MIT License
|
|
|
145
145
|
|
|
146
146
|
Copyright (c) <year> <copyright holders>
|
|
147
147
|
|
|
148
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
149
|
-
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
150
|
-
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
151
|
-
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
148
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
149
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
150
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
151
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
152
152
|
following conditions:
|
|
153
153
|
|
|
154
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
154
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
155
155
|
portions of the Software.
|
|
156
156
|
|
|
157
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
158
|
-
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
159
|
-
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
160
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
157
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
158
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
159
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
160
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
161
161
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
162
162
|
|
|
163
163
|
|