Skip to content

Commit

Permalink
pass cmid as session id (#176)
Browse files Browse the repository at this point in the history
* pass cmid as session id

* eslint

* flow
  • Loading branch information
wsbrunson authored Dec 14, 2023
1 parent df528dc commit 83bd65c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import { getStorage, type Storage } from "@krakenjs/belter/src";

import { getNamespace, getSDKAttribute } from "./script";

export function getClientMetadataID(): ?string {
return getSDKAttribute(SDK_SETTINGS.CLIENT_METADATA_ID);
}

function getSDKStorage(): Storage {
return getStorage({
name: getNamespace(),
stickySessionId: getClientMetadataID() || "",
});
}

Expand All @@ -26,7 +31,3 @@ export function getStorageID(): string {
export function getSessionState<T>(handler: (state: Object) => T): T {
return getSDKStorage().getSessionState(handler);
}

export function getClientMetadataID(): ?string {
return getSDKAttribute(SDK_SETTINGS.CLIENT_METADATA_ID);
}

0 comments on commit 83bd65c

Please sign in to comment.