Skip to content

Commit 6d0d7cb

Browse files
committed
Udpate README to correct import paths
1 parent e38c8c6 commit 6d0d7cb

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,44 @@ You can add as many signals as you need to track different interactions with you
6767
After installing the package via NPM, use it like this:
6868
6969
```js
70-
import { TelemetryDeck } from 'telemetry-deck';
70+
import { TelemetryDeck } from '@telemetrydeck/sdk';
7171
7272
const td = new TelemetryDeck({ app: YOUR_APP_ID, user: YOUR_USER_IDENTIFIER });
7373
74-
// Process any events that have been qeued up
75-
// Queued signals do not contain a client side timestamp and will be timestamped
76-
// on the server at the time of arrival. Consider adding a timestamp value to
77-
// your payloads if you need to be able to correlate them.
78-
const queuedEvents = [
79-
['app', YOUR_APP_ID],
80-
['user', YOUR_USER_IDENTIFIER],
81-
['signal'],
82-
['signal', { route: 'some/page/path' }],
83-
];
84-
td.ingest(qeuedEvents);
85-
8674
// Basic signal
8775
td.signal();
8876
89-
// Update app or user identifier
90-
td.app(YOUR_NEW_APP_ID);
91-
td.user(YOUR_NEW_USER_IDENTIFIER);
92-
93-
// Signal with custom payload
77+
// Adanced: Signal with custom payload
9478
td.signal({
9579
route: 'some/page/path',
9680
});
81+
9782
```
9883
9984
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, use it as `YOUR_USER_IDENTIFIER` – it will be cryptographically anonymized with a hash function.
10085
10186
If you want to pass optional parameters to the signal being sent, add them to the optional payload object.
10287
88+
You can also update your user identifier or queue events like this:
89+
90+
```js
91+
// Optional: Update app or user identifier
92+
td.app(YOUR_NEW_APP_ID);
93+
td.user(YOUR_NEW_USER_IDENTIFIER);
94+
95+
// Optional: Process any events that have been qeued up
96+
// Queued signals do not contain a client side timestamp and will be timestamped
97+
// on the server at the time of arrival. Consider adding a timestamp value to
98+
// your payloads if you need to be able to correlate them.
99+
const queuedEvents = [
100+
['app', YOUR_APP_ID],
101+
['user', YOUR_USER_IDENTIFIER],
102+
['signal'],
103+
['signal', { route: 'some/page/path' }],
104+
];
105+
td.ingest(qeuedEvents);
106+
```
107+
103108
## More Info
104109
105110
### 📱 You need an App ID

0 commit comments

Comments
 (0)