You have just achieved portable session replay. Welcome to data freedom.
Retention policies are necessary for cost management, but they can be a problem for vital data. In PostHog's cloud plans, a 5-year retention period is available only for Enterprise customers; other plans range from 30 days to 1 year [8†L12-L15]. However, by using portable exports, you can archive any recording indefinitely. You can export it as a JSON file for safekeeping in a data lake, then re-import it into PostHog for playback at any time, even after the original recording has expired [8†L20-L23].
import posthog from 'posthog-js' posthog.init(' ', // Point to your portable local proxy or internal server api_host: 'http://localhost:8010' ) Use code with caution. Step 2: Setting Up a Local Proxy or Gateway posthog session replay portable
Will your app be or just temporarily offline ?
Implement automated cron jobs within your portable gateway to purge local recording files after a set period (e.g., 7 or 14 days) to prevent disk space exhaustion and minimize data liability. Conclusion You have just achieved portable session replay
PostHog's frontend library ( posthog-js ) uses (record and replay the web) under the hood. It records mutations to the DOM, mouse movements, scroll events, and console logs, bundling them into JSON payloads.
PostHog allows you to export raw session replay events directly to Snowflake, BigQuery, or Redshift. Unlike other tools that give you aggregated CSV exports, PostHog streams the raw clickmap , mouse activity , and console logs into your warehouse. In PostHog's cloud plans, a 5-year retention period
"PostHog Session Replay Portable" means the ability to take the raw event stream of a user session, move it outside of PostHog’s UI, and process it using your own tools (SQL, Python, Spark) without performance penalties or legal friction.
posthog.init(' ', api_host: 'https://posthog.com', session_recording: maskAllInputs: true, maskTextSelector: '.sensitive-data-container', ); Use code with caution. Establish Data Lifecycle Policies
The requirement to be "portable" doesn't override the need to be privacy-conscious. PostHog allows you to mask sensitive information directly on the , meaning sensitive data is never sent to the server in the first place. You can define CSS selectors to block specific elements or use a custom masking function to obfuscate text while still capturing user behavior on the client.