cross-domain-storage v2.0.7 enables browser-localStorage sharing across subdomains and parent/child windows via postMessage. Low-maintenance, no new releases since 2016. Ideal for simple cross-origin persistence without server-side setup. Minimal API, uses iframe or window messaging. Lightweight, no external dependencies.
npm install cross-domain-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an iframe-based cross-domain storage, sets a key with TTL, and retrieves it on connection.
Ensure origin string matches parent window (e.g., 'https://example.com:443').
Encrypt data manually before setting, or use a secure origin with HTTPS.
Implement a manual timeout wrapper around the get method.
Place cross-domain-storage.html (from /dist) on the remote origin, or host it yourself.
Check that the origin includes the correct protocol, host, and port (e.g., 'http://localhost:8080').
Use import CrossDomainStorage from 'cross-domain-storage' (ESM) or const CrossDomainStorage = require('cross-domain-storage').default (CJS).No dependency data recorded yet.