Choose your plan

Starter

$100.00

per user

Pro

$300.00

per user

Enterprise

Contact us

bespoke pricing

//Paddle.Environment.set("sandbox");
Paddle.Setup({
  token: "66524c3cc2f2872bb27046226fc0b00d78b2b716c056a30979" // replace with a client-side token
});

// define products and prices
var starterProduct = "pro_639925";
var proProduct = "pro_653017";
var monthItems = [
  {
    quantity: 1,
    priceId: "pri_639925"
  },
  {
    quantity: 1,
    priceId: "pri_653017"
  }
];
var yearItems = [
  {
    quantity: 1,
    priceId: "pri_639925"
  },
  {
    quantity: 1,
    priceId: "pri_653017"
  }
];

// DOM queries
var starterPriceLabel = document.getElementById("starter-price");
var proPriceLabel = document.getElementById("pro-price");

// set initial billing cycle
var billingCycle = "year";

// set initial country
var billingCountry = "US";

// choose country
var dropdown = document.getElementById("country");
dropdown.addEventListener("change", function () {
  billingCountry = dropdown.value;
  console.log("country changed: " + billingCountry);
  getPrices(billingCycle);
});

// get prices
function getPrices(cycle) {
  if (cycle === "month") {
    var billingCycle = cycle;
    var itemsList = monthItems;
  } else if (cycle === "year") {
    var billingCycle = cycle;
    var itemsList = yearItems;
  }

  var request = {
    items: itemsList,
    address: {
      countryCode: billingCountry
    }
  };
  Paddle.PricePreview(request)
    .then((result) => {
      console.log(result);

      var items = result.data.details.lineItems;
      for (item of items) {
        if (item.product.id === starterProduct) {
          starterPriceLabel.innerHTML = item.formattedTotals.subtotal;
          console.log("starter " + item.formattedTotals.subtotal);
        } else if (item.product.id === proProduct) {
          proPriceLabel.innerHTML = item.formattedTotals.subtotal;
          console.log("pro " + item.formattedTotals.subtotal);
        }
      }
    })
    .catch((error) => {
      console.error(error);
    });
}