Skip to content

Releases: apphud/apphud.js

v2.3.4

16 Apr 04:32

Choose a tag to compare

What's new in v2.3.4:

  • Fixed Apple Pay so the payment sheet shows $0.00 due today when a Stripe free trial is configured, with a line item for the price after the trial (subscription creation was already correct; this aligns the sheet with billing).

v2.3.3

23 Jan 01:24

Choose a tag to compare

What's new in v2.3.3:

  • Fixed checkout logic to use API product.kind instead of product.store

v2.3.2

27 Oct 13:52

Choose a tag to compare

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

20 Oct 06:20

Choose a tag to compare

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

10 Jun 16:19

Choose a tag to compare

What's new in v2.3.0:

  • Tracks Purchase and StartTrial events 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

16 May 13:15
ecdf12e

Choose a tag to compare

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.token instead of hard-coded Stripe publishable keys
  • Add hide terms option for stripe form
apphud.paymentForm({
    id,
    paymentProvider: "stripe",
    // ...
    hideTerms: true,
})

v2.1.0

08 Apr 10:02

Choose a tag to compare

What's new in v2.1.0:

  • Added amplitude_id to metadata for customer and subscription creation in Stripe and Paddle

v2.0.1

25 Mar 01:08

Choose a tag to compare

What's new in v2.0.1:

  • Added disableCookies configuration 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

19 Mar 14:30
cba6be8

Choose a tag to compare

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, gclid as direct query parameters
    • Enhanced Facebook attribution with direct query parameter handling for fbp and fbc values, and cookie-based tracking to prevent duplicate ApphudInit events

Bug Fixes

  • Fixed Stripe inline checkout form by properly cleaning up submit event listeners
  • Fixed paywall_shown event being sent without required paywall_id and placement_id parameters
  • Fixed excessive sending of ApphudInit event 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']
});