The Stripe connector pulls live numbers from your Stripe account on a refresh cadence (cron) or in real time (webhook push). Bind a block to a Stripe query, declare a projection, and the platform keepsDocumentation Index
Fetch the complete documentation index at: https://docs.chatblocks.ai/llms.txt
Use this file to discover all available pages before exploring further.
widget.data fresh.
Add a Stripe data source
Go to the wizard
/settings/data-sources/new/stripe (or click “New data source” from /settings/data-sources and pick Stripe).Paste a restricted API key
Read-only is sufficient — the connector never writes back to Stripe. Generate a restricted key from your Stripe dashboard scoped to
Read on Subscriptions, Charges, and Balance.The plaintext is envelope-encrypted with your workspace’s DEK before it’s written to Convex. We never log or display it.Optionally paste a webhook signing secret
Skipping this puts the source in cron-mode — the platform polls Stripe on a cadence you pick (
5, 15, 60, 360, or 1440 minutes).Providing a signing secret enables push-mode — Stripe POSTs subscription / charge / balance events to a Convex webhook endpoint and the platform refreshes within seconds. The cadence dropdown still controls a safety-net background poll.Free workspaces can have at most one Stripe data source. Builder lifts the cap. See Plans and limits.
Query catalog
Three first-class queries. Seeapps/web/convex/lib/connectors/stripeQueries.ts for the implementations.
stripe.mrr
stripe.mrr
Sums the Use for an MRR metric widget.
unit_amount of every active subscription, paginated across the full set.Result:stripe.balance
stripe.balance
Calls Use for a “what’s my Stripe balance” widget.
/v1/balance and returns the available + pending breakdown.Result:stripe.recentCharges
stripe.recentCharges
Lists the most recent N charges (default 10, max 100).Result:Use for a recent-activity list widget.
Bind a block
In the block’schatblocks.json:
stripe.mrr on the configured cadence, applies the projection to map amount_cents → a formatted currency string, writes the result into widget.data, and pushes to iOS.
Projection format helpers (currency, number, percent, percent-with-sign, datetime) live in packages/shared/src/projection.ts. They’re pure functions — same input → same output, no side effects.
Refresh modes
- Cron-mode
- Push-mode
Default. The platform polls Stripe at
cadenceMinutes (5 / 15 / 60 / 360 / 1440). A 1-minute Convex cron scans active data sources and dispatches refreshes for any whose lastRefreshAt + cadenceMinutes < now.Per-binding failures don’t poison the source — one failing query won’t stop the others from refreshing. A source-level auth failure (revoked API key, etc.) sets lastErrorMessage on the source and surfaces in the data-sources list.Credential storage and audit
The credential blob is JSON:{ apiKey, webhookSecret? }. Encrypted via the workspace DEK (envelope encryption with a master KEK in Convex env). Every decryption — every refresh — writes an auditLog row stamped actor: "system:scheduledRunner" or actor: "system:stripeWebhook" so you can see exactly when the key was used.
See Audit log for the full event surface.
What’s next
Postgres
Point at your own Postgres and write SQL queries with platform-side safety wrapping.
Webhook
Receive arbitrary JSON from your own systems with HMAC-signed delivery.