Stancer

Convex component that integrates Stancer payments with callback-driven status sync, eliminating webhooks and customer portal complexity.

Installation

npm install convex-stancer

About Stancer

The Stancer component provides payment processing integration for Convex applications using callback-based status synchronization instead of webhooks. It manages customers, payment intents, and payment status tracking through Convex tables, with explicit sync calls after payment completion. The component handles the complete payment flow from intent creation to status updates via Stancer's redirect-based payment system.

Benefits

Use cases

how to integrate Stancer payments with Convex backend

Use convex-stancer to create payment intents server-side with StancerPayments class, redirect users to Stancer's payment URL, then sync payment status after callback. The component handles customer creation and payment tracking automatically.

Convex payment processing without webhooks

The convex-stancer component uses callback-driven status sync instead of webhooks. After payment completion, Stancer redirects to your callback URL where you call syncPaymentIntentStatus to update Convex tables with the latest payment status.

query payment data in Convex app

Access payment information through built-in public queries like getPaymentIntent, listPaymentsByUserId, getCustomerByEmail, and listSubscriptionsByOrgId. The component provides comprehensive read access to all payment-related data.

Frequently asked questions

Does convex-stancer require webhook configuration?

No, convex-stancer uses a callback-driven approach instead of webhooks. After payment completion, Stancer redirects users back to your app where you explicitly sync payment status using the syncPaymentIntentStatus method.

Can I use StancerPayments class in browser code?

No, the StancerPayments class is server-only and must be used in Convex actions or other trusted server runtimes. The component explicitly rejects browser runtimes to prevent leaking your STANCER_API_KEY.

How does payment status synchronization work?

convex-stancer requires explicit sync calls after payment callbacks. When Stancer redirects back to your app, call syncPaymentAfterCallback with the paymentIntentId to fetch the latest status and update your Convex tables.

What environment variables does convex-stancer need?

convex-stancer requires STANCER_API_KEY (your secret key starting with stest_ or sprod_) and APP_URL (your frontend base URL for return_url callbacks). Configure these in your Convex Dashboard.

Links