Skip to content

Commit e235914

Browse files
authored
Merge pull request #7 from ridi/dev/0.1/add-ruid
Add ruid getter
2 parents 8087c1e + 568fff5 commit e235914

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ridi/event-client",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Ridibooks event tracking client",
55
"main": "dist/cjs/index.js",
66
"typings": "dist/typings/index.d.ts",

src/eventClient.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Cookies from 'js-cookie';
12
import { DeviceType, LoginMethod } from './constants';
23
import { loadTagManager } from './utils/externalServices';
34
import { Item, PurchaseInfo } from './models';
@@ -40,6 +41,12 @@ export class EventClient {
4041
return window.dataLayer;
4142
}
4243

44+
// TODO: Generate Ruid if not exists
45+
public get ruid(): string | undefined {
46+
const ruid = Cookies.get('ruid') || undefined;
47+
return ruid;
48+
}
49+
4350
public setUId(uId: number): void {
4451
this.options.uId = uId;
4552

0 commit comments

Comments
 (0)