@beamimpact/web-sdk
Version:
The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their
3 lines (2 loc) • 810 B
JavaScript
import{v as d}from"./vendor-KKSARHWL.esm.js";import{getCookieValue as i,setCookieValue as p,deleteCookieValue as l}from"../utils/cookies.esm.js";import{createScopedLocalStorage as n}from"../utils/local-storage.esm.js";const s="beam_session";async function r({cookieName:e=s,domain:o=window.location.hostname,apiKey:t=""}={}){if(await i(e))return;const a=d(),m=Date.now()+30*24*60*60*1e3;await p({name:e,value:a,domain:o,path:"/",expires:m}),n({apiKey:t}).setItemJson("cart",{cartId:a})}async function c({cookieName:e=s,domain:o=window.location.hostname,apiKey:t=""}={}){const a=await i(e);a&&(n({apiKey:t}).setItemJson("cart",{cartId:a}),await l({name:e,domain:o}))}var u=Object.freeze({__proto__:null,createSession:r,endSession:c});export{r as c,c as e,u as i};
//# sourceMappingURL=index-IKiJwo5v.esm.js.map