UNPKG

tiny-utm-keeper

Version:

Zero-dependency, TypeScript-first UTM parameter tracker for first-touch/last-touch attribution. SSR-friendly.

30 lines (29 loc) 865 B
import { StoredUTMData, UTMParams } from './types.js'; /** * Check if we're in a browser environment */ export declare const isBrowser: () => boolean; /** * Safely get item from localStorage */ export declare const getStorageItem: (key: string) => string | null; /** * Safely set item in localStorage */ export declare const setStorageItem: (key: string, value: string) => boolean; /** * Safely remove item from localStorage */ export declare const removeStorageItem: (key: string) => boolean; /** * Get stored UTM data */ export declare const getStoredUTMData: (storageKey: string) => StoredUTMData | null; /** * Save UTM data to storage */ export declare const saveUTMData: (storageKey: string, params: UTMParams, expirationDays: number) => boolean; /** * Clear stored UTM data */ export declare const clearUTMData: (storageKey: string) => boolean;