Stripe Auto-Setup
Connect your Stripe account to Affitor with a single command. Automatically configures webhooks for payment tracking.
Quick Setup
npx affitor setup stripe
This command:
- Opens your browser to authorize Stripe Connect (read-only access)
- Creates a webhook endpoint on your Stripe account pointing to Affitor
- Subscribes to the required payment events
- Saves the connection to your Affitor program
What Gets Configured
The CLI creates a webhook endpoint that listens for:
| Event | Purpose |
|---|---|
customer.created |
New customer attribution |
checkout.session.completed |
One-time payment tracking |
invoice.paid |
Subscription payment tracking |
invoice.payment_failed |
Failed payment handling |
charge.refunded |
Refund processing |
customer.subscription.deleted |
Churn tracking |
Prerequisites
- Run
npx affitor initfirst (creates your program) - Have a Stripe account with API access
.affitor/config.jsonmust exist in your project
After Setup
Verify the connection:
npx affitor status
Test a sale event:
npx affitor test sale
You can also verify in your Stripe Dashboard under Developers → Webhooks — you should see the Affitor endpoint listed.
Manual Alternative
If you prefer not to use OAuth, you can add Stripe metadata manually instead. See the sale-tracking skill for the metadata approach.