Releases: apphud/apphud.js
Releases · apphud/apphud.js
v2.3.4
v2.3.3
What's new in v2.3.3:
- Fixed checkout logic to use API
product.kindinstead ofproduct.store
v2.3.2
What's new in v2.3.2:
- Stripe customers are now reused across the entire checkout flow (main checkout, discount checkout), eliminating redundant API calls
- Fixed duplicate customer creation when both Apple Pay and card payment forms are initialized simultaneously
v2.3.1
What's new in v2.3.1:
Bug Fixes:
Stripe Payment Forms:
- Fixed race condition when products are changed while the payment form is initializing. Previously, if a product changed during form initialization, the old form instance could complete its setup and attach event listeners for the wrong product, potentially causing incorrect purchases.
- Added cancellation mechanism to ensure only the current form instance processes payments
Apple Pay:
- Fixed issue where unnecessary payment methods were being specified during customer creation for Apple Pay. This could cause errors if any of those methods were unavailable, breaking Apple Pay functionality unnecessarily.
v2.3.0
What's new in v2.3.0:
- Tracks
PurchaseandStartTrialevents to Meta Pixel for all payment providers after successful subscriptions with event deduplication - User ID is now generated during initialization, making
getUserID()immediately available without waiting for async user creation
v2.2.0
What's new in v2.2.0:
- Add standalone Apple Pay button support in Stripe payment form
apphud.paymentForm({
id,
paymentProvider: "stripe",
applePay: true,
applePayConfig: {
// Use price from product bundle with specified macro
priceMacro: "new-price",
// Use product name from bundle with specified macro
productMacro: "custom-1",
// OR directly set the product label
productLabel: "Premium Subscription",
// OR use static price directly
staticPrice: {
currency: "usd",
amount: 999, // $9.99
},
// Additional configuration
requestPayerName?: true;
requestPayerEmail?: true;
requestPayerPhone?: false;
onApplePayAvailable: (isAvailable) => {
console.log("Apple Pay available:", isAvailable);
}
}
})- Use
provider.tokeninstead of hard-coded Stripe publishable keys - Add hide terms option for stripe form
apphud.paymentForm({
id,
paymentProvider: "stripe",
// ...
hideTerms: true,
})v2.1.0
What's new in v2.1.0:
- Added
amplitude_idto metadata for customer and subscription creation in Stripe and Paddle
v2.0.1
What's new in v2.0.1:
- Added
disableCookiesconfiguration option to disable user cookies while maintaining in-memory user identity - New user ID will be generated on page reload when in cookieless mode, ideal for testing purposes
v2.0.0
What's New in v2.0.0:
[Breaking] Payment Method Configuration Changes
Payment method configuration has been moved from global config to payment form options. Instead of using config.options?.use_sepa_debit, now provide payment methods directly to the form:
apphud.paymentForm({
stripePaymentMethods: ['card', 'sepa_debit', 'bancontact']
});Major Features
- Paddle Support: Added full support for Paddle payment provider alongside Stripe
- Payment Forms Customization: Enhanced options for customizing payment form appearance and behavior:
apphud.paymentForm({
id: "form-id",
// Specify which payment provider to use (optional)
paymentProvider: "stripe", // "stripe" or "paddle"
// Stripe-specific appearance customization
stripeAppearance: {
theme: "stripe",
variables: { colorPrimary: '#0570de' , ...}
},
// Payment methods for Stripe (default: ['card'])
stripePaymentMethods: ['card', 'sepa_debit'],
// Paddle-specific settings (when using Paddle)
// paddleSettings: {
// theme: 'light',
// displayMode: 'overlay'
// },
onSuccess: () => { /* Handle successful payment */ },
});- Upsell Support: Implement upsell flows with dedicated API:
apphud.createUpsellSubscription({
onSuccess: () => {
// Handle successful upsell
},
paddleSettings: {
// Paddle-specific settings for upsell checkout
}
});- Product Bundles: Support for the new product bundles structure in paywalls
- Trials and Discounts: Added support for introductory offers including free trials and discounts
Improvements
- Error Reporting: Added error reporting to Apphud analytics
- Attribution Enhancements:
- Improved Google Tag Manager attribution with better client ID handling
- Improved attribution parameters handling, now including
ttclid,fbclid,gclidas direct query parameters - Enhanced Facebook attribution with direct query parameter handling for
fbpandfbcvalues, and cookie-based tracking to prevent duplicateApphudInitevents
Bug Fixes
- Fixed Stripe inline checkout form by properly cleaning up submit event listeners
- Fixed
paywall_shownevent being sent without requiredpaywall_idandplacement_idparameters - Fixed excessive sending of
ApphudInitevent to Facebook pixel - Fixed redundant calls to backend customers API endpoint
Notes
- For Stripe upsells, the subscription is created without requiring additional card data
- For Paddle upsells, users will be prompted to enter card data in the Paddle checkout
Migration Guide
For payment methods, replace global configuration:
// Old (v1.x)
apphud.init({
apiKey: "YOUR_API_KEY",
options: {
use_sepa_debit: true,
use_bancontact: true
}
});
// New (v2.0.0)
apphud.init({
apiKey: "YOUR_API_KEY"
});
// Then specify payment methods when showing form:
apphud.paymentForm({
stripePaymentMethods: ['card', 'sepa_debit', 'bancontact']
});