JS
JavaScript SDK
v1.0.0The official JavaScript library for Retake. Works with any backend (Node.js, Express, etc) or frontend.
Fast Setup
Type-Safe
Webhooks
Backend Ready
Installation
bash
E-commerce Flow
1. Cart Abandonment
Track when a user keeps adding items. If they leave here, we'll email them their cart.
typescript
2. Proceed to Payment
Track just before redirecting to Stripe/Paddle. This captures the highest intent.
typescript
3. Track Conversion
When the user pays, tell Retake immediately so we stop sending emails. Safe to call from client or server.
typescript
SaaS Flow
Pricing Interest
Track when known users check your pricing page.
typescript
Upgrade Intent
Track when a user tries to upgrade their plan.
typescript
Handling Returning Users
When a user clicks the recovery link, use this to restore their state (cart, plan selection, etc).
typescript
Core Functions
track(options)The main function. Tracks any event: 'cart', 'checkout', 'pricing', 'upgrade'.
trackConversion(options)Critical! Call this on payment success to stop recovery emails.