Skip to main content

PostHog event intake for product and data teams

Your PostHog SDKs keep capturing. Send2Bucket stores each event as one JSON line in your S3 or GCS bucket, Iceberg or DuckLake table, at $0.50 a GB above the 50 GB in Pro.

set up in four steps

  1. Create a stream and a key

    In the dashboard, create an ingestion stream, add a destination and copy its API key. The key ships inside web apps, so use one that writes only to this stream.

    the host, per key
    # a key for one stream
    https://api.send2bucket.com/v1/events/posthog
    
    # a key for several streams names the stream
    https://api.send2bucket.com/v1/events/posthog/<stream_id>
  2. Set the host

    posthog-js takes api_host; posthog-python and posthog-node take host. Other SDKs take the same host in their own setting.

    posthog-js, posthog-python, posthog-node
    posthog.init('<key>', {
      api_host: 'https://api.send2bucket.com/v1/events/posthog',
    });
    
    from posthog import Posthog
    
    posthog = Posthog("<key>", host="https://api.send2bucket.com/v1/events/posthog")
    
    const client = new PostHog('<key>', { host: 'https://api.send2bucket.com/v1/events/posthog' });
  3. Capture one event

    The check posts one event to /i/v0/e/. A 200 means it is stored durably and will be delivered at least once.

    check the endpoint
    curl -i https://api.send2bucket.com/v1/events/posthog/i/v0/e/ \
      -H "Content-Type: application/json" \
      --data "{\"api_key\":\"$S2B_API_KEY\",\"event\":\"hello from curl\",\"distinct_id\":\"check\"}"
    
    # <- 200
    {"status":1}
  4. Query the events

    DuckDB reads the objects in place. In an Iceberg or DuckLake table the same line is the payload column.

    duckdb · daily users
    SELECT CAST(TRY_CAST(data->>'$.timestamp' AS TIMESTAMPTZ) AS DATE) AS day,
           count(DISTINCT coalesce(data->>'$.distinct_id', data->>'$.properties.distinct_id')) AS users
    FROM posthog
    WHERE data->>'$.event' <> '$snapshot'
    GROUP BY ALL
    ORDER BY day;
    
    ┌────────────┬───────┐
    │    day     │ users │
    │    date    │ int64 │
    ├────────────┼───────┤
    │ 2026-11-24 │     6 │
    └────────────┴───────┘

session recordings, when you ask for them

Recordings turn on when the host ends in /recordings. posthog-js then loads its recorder from asset_host, a site of yours serving the package's dist files under /static/.

posthog-js, recordings on
posthog.init('<key>', {
  api_host: 'https://api.send2bucket.com/v1/events/posthog/recordings',
  asset_host: 'https://<your_site>',
});
endpoint
/s/, stored as $snapshot events
inputs
masked, as posthog-js records them
-> dlv_003620l9lnj97uhc51q7mpl8gml48.ndjson.gz
{
  "v": 1,
  "delivery_batch_id": "dlv_003620l9lnj97uhc51q7mpl8gml48",
  "stream_id": "4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17",
  "batch_id": "bat_003620l9ef17go0bkr860hft5upe8",
  "received_at": "2026-11-24T09:52:01.028728Z",
  "signal": "event",
  "data": {
    "uuid": "01a20cf8-2dff-7ae0-90c7-3a1cda1bd6f0",
    "event": "$snapshot",
    "properties": {
      "$snapshot_bytes": 7670,
      "$snapshot_data": [
        {"type": 4, "data": {"href": "…/checkout", "width": 1280, "height": 720}, "timestamp": 1795513915921},
        …
        {"type": 3, "data": {"source": 2, "type": 2, "id": 10, "x": 27, "y": 90, "pointerType": 0}, "timestamp": 1795513919020},
        {"type": 3, "data": {"source": 5, "text": "*******", "isChecked": false, "id": 12}, "timestamp": 1795513919044},
        …
      ],
      "$session_id": "01a20cf8-1a04-7e3b-8b31-ae4c8f8c3878",
      "$lib": "web",
      "$lib_version": "1.454.2",
      …
    },
    "timestamp": "2026-11-24T09:52:01.023Z",
    "sent_at": "2026-11-24T09:52:01.023Z"
  }
}

$ s2b init

point posthog at your bucket

Change one setting in the SDK. Delivered data stays in your account after you disconnect.

the one setting
posthog.init('<key>', {
  api_host: 'https://api.send2bucket.com/v1/events/posthog',
});
-> where the lines land
# the layout
<prefix>/s2b/stream=<stream_id>/date=YYYY-MM-DD/hour=HH/<delivery_batch_id>.ndjson.gz

# the $snapshot line above
s3://analytics-raw/raw/s2b/stream=4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17/date=2026-11-24/hour=09/dlv_003620l9lnj97uhc51q7mpl8gml48.ndjson.gz