Integration Patterns

These are just some common integration patterns, which might help with your SDK integration.

Pattern 1: Single Product Button

Best for landing pages with one product:

const button = new ButtonDynamicPrice({
  price: 49.99,
  apiKey: "your_api_key",
  title: "Buy Premium Plan - $49.99",
  style: {
    backgroundColor: '#6366f1',
    padding: '16px 32px',
    fontSize: '18px'
  }
});

Pattern 2: Multiple Product Buttons

Best for product catalogs:

const products = [
  { id: 1, name: 'Basic Plan', price: 9.99 },
  { id: 2, name: 'Pro Plan', price: 29.99 },
  { id: 3, name: 'Enterprise Plan', price: 99.99 }
];

products.forEach(product => {
  const button = new ButtonDynamicPrice({
    price: product.price,
    apiKey: "your_api_key",
    title: `Buy ${product.name}`,
    customOrderId: `product_${product.id}`
  });

  document.getElementById(`button-${product.id}`)
    .appendChild(button.render());
});

Pattern 3: Dynamic Pricing

Best for quantity selectors or custom amounts:

Last updated

Was this helpful?