Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TargetClient.TargetQAModeCookieName #115

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/target-nodejs-sdk/src/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const TARGET_COOKIE = "mbox";
export const SESSION_ID_COOKIE = "session";
export const DEVICE_ID_COOKIE = "PC";
export const LOCATION_HINT_COOKIE = "mboxEdgeCluster";
export const QA_MODE_COOKIE = "at_qa_mode";

function createInternalCookie(name, value, expires) {
return { name, value, expires };
Expand Down
6 changes: 5 additions & 1 deletion packages/target-nodejs-sdk/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Visitor from "@adobe-mcid/visitor-js-server";
import TargetDecisioningEngine from "@adobe/target-decisioning-engine";
import { createVisitor } from "./utils";
import { Messages } from "./messages";
import { LOCATION_HINT_COOKIE, TARGET_COOKIE } from "./cookies";
import { LOCATION_HINT_COOKIE, TARGET_COOKIE, QA_MODE_COOKIE } from "./cookies";
import { executeDelivery } from "./target";
import { preserveLocationHint, requestLocationHintCookie } from "./helper";

Expand Down Expand Up @@ -265,6 +265,10 @@ export default function bootstrap(fetchApi) {
return LOCATION_HINT_COOKIE;
}

static get TargetQaModeCookieName() {
return QA_MODE_COOKIE;
}

static get AuthState() {
return Visitor.AuthState;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/target-nodejs-sdk/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ describe("Target Client factory", () => {
);
});

it("should return qa mode cookie name", () => {
expect(TargetClient.TargetQaModeCookieName).toBe("at_qa_mode");
});

it("should return Visitor Auth State", () => {
expect(TargetClient.AuthState).toEqual(AUTH_STATE);
});
Expand Down