Skip to content

Commit 6dc5b73

Browse files
committed
Add more readme content
1 parent 075e2aa commit 6dc5b73

File tree

1 file changed

+68
-7
lines changed

1 file changed

+68
-7
lines changed

README.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
11
# Telemetry Deck JavaScript SDK
22

3-
Support modern evergreen browsers which support [cryptography](https://caniuse.com/cryptography).
3+
This package allows you to send signals to [TelemetryDeck](https://telemetrydeck.com) from your JavaScript code.
4+
5+
It has no package dependencies and supports modern evergreen browsers which support [cryptography](https://caniuse.com/cryptography).
6+
7+
Signals sent with this version of the SDK automatically send the following payload items:
8+
9+
- url
10+
- useragent
11+
- locale
12+
- platform
13+
14+
You can filter and show these values in the TelemetryDeck dashboard.
15+
16+
Test Mode is currently not supported.
417

518
## Usage
619

7-
### For applications that use a bundler (like Webpack, Rollup, …)
20+
### 📄 Usage via Script Tag
21+
22+
For regular websites and to try out the code quickly, you can use [UNPKG](https://unpkg.com), a free CDN which allows you to load files from any npm package.
23+
24+
Include the following snippet in your page header:
25+
26+
```html
27+
<script src="https://unpkg.com/@telemtrydeck/sdk/dist/telemetrydeck.min.js">
28+
```
29+
30+
then include a script tag at the bottom of your page like this to send a signal once every time the page loads:
31+
32+
```html
33+
<script>
34+
signal(
35+
// required options to identify your app and the user
36+
{
37+
appID: 'YOUR_APP_ID',
38+
userIdentifier: 'ANONYMOUS',
39+
},
40+
// optional: custom payload stored with the signal
41+
{
42+
route: 'some/page/path',
43+
}
44+
);
45+
</script>
46+
```
47+
48+
Please replace `YOUR_APP_ID` with the app ID you received from TelemetryDeck, and set a user identifier if possible.
49+
50+
### 📦 Usage for applications that use a bundler (like Webpack, Rollup, …)
51+
52+
After installing the package via NPM, use it like this:
853

954
```js
1055
import { signal } from 'telemetry-deck';
@@ -23,10 +68,26 @@ signal(
2368
);
2469
```
2570

26-
### For situations where you just want to add a script tag and generate signals
71+
Please replace `YOUR_APP_ID` with the app ID you received from TelemetryDeck. If you have any string that identifies your user, such as an email address, pass it into `userIdentifier` – it will be cryptographically anonymized with a hash function.
2772

28-
[UNPKG](https://unpkg.com) is a free CDN which allows you to load files from any npm package.
73+
If you want to pass optional parameters to the signal being sent, add them to the optional paylaod object.
2974

30-
```html
31-
<script src="https://unpkg.com/@telemtrydeck/sdk/dist/telemetrydeck.min.js">
32-
```
75+
## More Info
76+
77+
### 📱 You need an App ID
78+
79+
Every application and website registered to TelemetryDeck has its own unique ID that we use to assign incoming signals to the correct app. To get started, create a new app in the TelemetryDeck UI and copy its ID.
80+
81+
### 👤 Optional: User Identifiers
82+
83+
TelemetryDeck can count users if you assign it a unique identifier for each user that doesn't change. This identifier can be any string that is unique to the user, such as their email address, or a randomly generated UUID.
84+
85+
Feel free to use personally identifiable information as the user identifier: We use a cryptographically secure double-hasing process on client and server to make sure the data that arrives at our servers is anonymized and can not be traced back to individual users via their identifiers. A user's identifier is hashed inside the library, and then salted+hashed again on arrival at the server. This way the data is anonymized as defined by the GDPR and you don't have to ask for user consent for procesing or storing this data.
86+
87+
### 🚛 Optional: Payload
88+
89+
You can optionally attach an object with string values to the signal. This will allow you to filter and aggregate signal by these values in the dashboard.
90+
91+
### 📚 Full Docs
92+
93+
Go to [docs.telemetrydeck.com](https://docs.telemetrydeck.com) to see all documentation articles

0 commit comments

Comments
 (0)