UNPKG

@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

27 lines (24 loc) 1.05 kB
import * as lodash from 'lodash'; import { B as BeamBaseAPIConfig } from './types-DfRc36jU.esm.js'; import { a as TCartApi } from './cart-contents-CLT7p7Gd.esm.js'; type BeamCartAPIConfig = BeamBaseAPIConfig & { storeId: number; domain?: string; statsigExperiment?: string; }; type BeamCartValues = { cartId?: string; itemCount?: number; subtotal?: number; currencyCode?: string; } & Partial<TCartApi>; /** * Sends cart information to Beam * Memoized based on previous arguments - if the objects are deep-equal, no update is made. * @side-effects Sets beam_cart cookie, set cart data in localstorage * @example * const BeamConfig = { apiKey: 'abc-123' } * const { beamCartId } = await updateCart(BeamConfig, { beamCartId, itemCount, subtotal, currencyCode }) * */ declare const updateCart: lodash.DebouncedFuncLeading<(config: BeamCartAPIConfig, cartValues: BeamCartValues, isFirstCartUpdateOnPageLoad?: any) => Promise<void>>; export { type BeamCartAPIConfig as B, type BeamCartValues as a, updateCart as u };