Skip to content

POC: Add --all-snapshot and --all-thin flags#1765

Draft
yahanxing-stripe wants to merge 3 commits into
masterfrom
yx/poc-all-snapshot-thin
Draft

POC: Add --all-snapshot and --all-thin flags#1765
yahanxing-stripe wants to merge 3 commits into
masterfrom
yx/poc-all-snapshot-thin

Conversation

@yahanxing-stripe

Copy link
Copy Markdown
Contributor

Summary

Builds on #1764. Adds --all-snapshot and --all-thin flags to explicitly subscribe to all events of a given payload style, replacing the ambiguous --events "*" wildcard.

  • --events default changes from ["*"] to [] (no implicit subscription)
  • Bare stripe listen with no flags opens both channels (firehose mode)
  • --all-snapshot --forward-to ... replaces old --events "*" --forward-to ...
  • --all-thin --forward-to ... replaces old --thin-events "*" --forward-thin-to ...

🤖 Generated with Claude Code

yahanxing-stripe and others added 3 commits July 9, 2026 10:37
This is a v2 breaking change that removes the separate --thin-events,
--forward-thin-to, and --forward-thin-connect-to flags. Instead, the
unified --events flag accepts both snapshot event types (e.g.
charge.captured) and thin event types (e.g. v1.billing.meter.no_meter_found),
auto-detecting the payload style from the event name pattern (v[0-9]+. prefix).

The --forward-to flag now forwards both snapshot and thin events to the
same destination. Internally, events are still split into two channels
(webhooks + v2_events) for the proxy layer.

Key behavior changes:
- `stripe listen` with default --events "*" now opens BOTH websocket
  channels (snapshot + thin)
- `--forward-to` forwards both payload styles to the same URL
- `--forward-connect-to` forwards both payload styles for connect events

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
Adds --events-from <self|accounts|all> to separate the "where events
come from" concern from "where events go". This replaces the pattern of
using --forward-connect-to as the only way to receive connect events.

Examples:
  stripe listen --events-from accounts --forward-to localhost:4242/webhook
  stripe listen --events-from self -e charge.captured --forward-to ...
  stripe listen --events-from all --forward-to ...  (default)

--forward-connect-to is kept as syntactic sugar for routing connect
events to a different URL than direct events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
Adds explicit flags to subscribe to all events of a given payload style,
solving the ambiguity of what "*" means when both channels exist.

- --all-snapshot: subscribe to all snapshot events
- --all-thin: subscribe to all thin events
- --events default changes from ["*"] to [] (empty)
- Bare "stripe listen" with no flags opens both channels (firehose)

Examples:
  stripe listen --all-thin --forward-to localhost:4242/webhook
  stripe listen --all-snapshot --events-from accounts --forward-to ...

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
@yahanxing-stripe yahanxing-stripe force-pushed the yx/poc-all-snapshot-thin branch from f44a9dc to f95f465 Compare July 9, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant