UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

26 lines (25 loc) 773 B
import r from "../managers/braze-instance.js"; import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js"; import et from "../triggers/models/trigger-events.js"; import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js"; export function openSession() { if (!r.rr()) return; const i = r.nn(); if (!i) return; i.openSession(); const t = tt.Ls.Fs, o = new tt(t, N); o.cr(t.Ms.jr, (r, n) => { const e = n.lastClick, s = n.trackingString; N.info(`Firing push click trigger from ${s} push click at ${e}`); const c = i.lr(e, s), g = function () { ot.m().Ce(et.hr, [s], c); }; i.br(g, g), o.ge(t.Ms.jr, r); }), o.Ns(t.Ms.kr, function (r) { i.vr(r); }); }