@esri/telemetry-amazon 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +71 -15
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,8 +1,21 @@
1
- # `ArcGIS Telemetry Amazon`
1
+ # `@esri/telemetry-amazon`
2
2
 
3
- This library exports the `telemetry-amazon` plugin for the `Telemetry.js` package to interact with AWS Analytics store. This package uses the [analytics](https://github.com/DavidWells/analytics) and [@analytics/aws-pinpoint](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-aws-pinpoint) packages.
3
+ > This is a plugin for the `Telemetry.js` package to interact with an AWS Analytics store. This package uses the third-party libraries, [analytics](https://github.com/DavidWells/analytics) and [@analytics/aws-pinpoint](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-aws-pinpoint) packages.
4
4
 
5
- ## Installation
5
+ ## Table of Contents
6
+
7
+ - [`@esri/telemetry-amazon`](#esritelemetry-amazon)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [How to Use](#how-to-use)
10
+ - [Amazon Configuration](#amazon-configuration)
11
+ - [Example](#example)
12
+ - [`telemetry.logEvent(event)`](#telemetrylogeventevent)
13
+ - [Telemetry Sharing Permissions](#telemetry-sharing-permissions)
14
+ - [Portal Items](#portal-items)
15
+ - [Usage](#usage)
16
+ - [Issues](#issues)
17
+ - [Contributing](#contributing)
18
+ - [License](#license)
6
19
 
7
20
  ```sh
8
21
  npm install @esri/telemetry
@@ -11,7 +24,7 @@ npm install @esri/telemetry-amazon
11
24
 
12
25
  ## How to Use
13
26
 
14
- `@esri/telemetry-amazon` packages works in the client-side browser and (WIP server-side Node.js). To use, install the package, include it in your project, and create an instance of the plugin, and pass it as an `plugin` with [@esri/telemetry](../../README.md)
27
+ `@esri/telemetry-amazon` packages works in the client-side browser and server-side Node.js. To use, install the package, include it in your project, create an instance of the plugin, and add it to the `plugins` array with [@esri/telemetry](../../README.md)
15
28
 
16
29
  Below is an example of how to use the telemetry-amazon plugin.
17
30
 
@@ -40,39 +53,57 @@ const telemetryOptions = {
40
53
  const telemetry = new Telemetry(telemetryOptions);
41
54
 
42
55
  telemetry.logPageView();
56
+
43
57
  telemetry.logEvent();
44
58
  ```
45
59
 
46
- After initializing `Telemetry.js`with the `telemetry-amazon`plugin, telemetry data will be sent to the AWS Pinpoint instance of the provided App.
60
+ After initializing `Telemetry.js` with the `telemetry-amazon` plugin, telemetry data will be sent to the AWS Pinpoint instance of the provided App.
47
61
 
48
- ### Amazon Analytics Configuration
62
+ ## Amazon Configuration
49
63
 
50
64
  - Get your app and user pool ID from AWS Pinpoint instance
51
- - Pass in options for `amazon` when initiating the Telemetry object
65
+ - Pass in options object to create an instance of the plugin
52
66
  - the `fips` option determines if AWS FIPS endpoints are used for cognito and pinpoint requests
67
+ - Pass in an object containing the mapping for your custom dimensions and metrics
68
+
69
+ ```js
70
+ // or if you are using optional custom dimensions and/or custom metrics
71
+ const googleTracker = new Amazon({
72
+ dimensions: {
73
+ datasetID: 1,
74
+ attribute: 2,
75
+ serviceQuery: 3,
76
+ },
77
+ metrics: {
78
+ duration: 1,
79
+ size: 2,
80
+ },
81
+ });
82
+ ```
53
83
 
54
84
  If you need to disable tracking you can set `disabled: true` when initializing the `Telemetry` object. Then you can continue to call the methods on your instance of `Telemetry` without throwing exceptions or logging errors.
55
85
 
56
86
  Additionally, you can disable individual trackers when initializing the `Telemetry` object by passing `disabled: true` in the tracker options.
57
87
 
58
88
  ```js
59
- {
60
- amazonOptions: {
61
- disabled: true,
62
- ...
63
- }
64
- }
65
-
89
+ const amazonTracker = new Amazon({
90
+ disabled: true,
91
+ });
66
92
  ```
67
93
 
68
94
  Post initialization, it is possible to disable & enable specific trackers using `disableTracker` and `enableTracker` methods.
69
95
 
70
96
  ```js
71
97
  telemetry.disableTracker('amazon');
98
+
72
99
  telemetry.logPageView(); // no amazon page view logged
100
+
73
101
  telemetry.logEvent(); // no amazon event logged
102
+
74
103
  telemetry.enableTracker('amazon');
104
+
75
105
  telemetry.logPageView(); // amazon page view logged
106
+
76
107
  telemetry.logEvent(); // amazon event logged
77
108
  ```
78
109
 
@@ -109,7 +140,6 @@ telemetry.logEvent(event);
109
140
 
110
141
  ```js
111
142
  import Amazon from '@esri/telemetry-amazon'
112
-
113
143
  ...
114
144
 
115
145
  const getAccessParams = {
@@ -133,3 +163,29 @@ const setAccessParams = {
133
163
 
134
164
  const result = await Amazon.setAccessPermissions(setAccessParams: ISetAccessPermissionsParams)
135
165
  ```
166
+
167
+ ## Issues
168
+
169
+ If something isn't working, please take a look at [previously logged issues](https://devtopia.esri.com/WebGIS/arcgis-telemetry.js/issues) first. Have you found a new bug? Create an issue [here](https://devtopia.esri.com/WebGIS/arcgis-telemetry.js/issues/new).
170
+
171
+ ## Contributing
172
+
173
+ Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](../../CONTRIBUTING.md).
174
+
175
+ ## License
176
+
177
+ Copyright © 2022 Esri
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ > http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.
190
+
191
+ A copy of the license is available in the repository's [LICENSE](../../LICENSE) file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/telemetry-amazon",
3
- "version": "0.4.0",
3
+ "version": "0.4.3",
4
4
  "description": "Amazon plugin for 'Telemetry.js' library",
5
5
  "homepage": "https://devtopia.esri.com/WebGIS/arcgis-telemetry.js/packages/telemetry-amazon#readme",
6
6
  "license": "Apache-2.0",
@@ -44,14 +44,14 @@
44
44
  "@analytics/aws-pinpoint": "^0.7.1",
45
45
  "@esri/arcgis-rest-portal": "^3.4.3",
46
46
  "@esri/arcgis-rest-request": "^3.4.3",
47
- "@esri/telemetry-shared": "^0.1.5",
47
+ "@esri/telemetry-shared": "^0.1.6",
48
48
  "analytics": "^0.7.18"
49
49
  },
50
50
  "devDependencies": {
51
- "@esri/telemetry": "^4.2.1"
51
+ "@esri/telemetry": "^5.0.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@esri/telemetry": "^4.0.0"
54
+ "@esri/telemetry": "^5.0.0"
55
55
  },
56
- "gitHead": "0bf2fb00d5b5048ee22f57f973bf06895b733456"
56
+ "gitHead": "2ae804471adc25bd4545779be01344b145edd4eb"
57
57
  }