Skip to main content

Discount SDK

Use this SDK in your frontend application to embed one or more discounts from the Dintero Discount Service service in your webpage.

Installation

npm install @dintero/discounts-web-sdk

Inline HTML JavaScript Example - Getting a list of discounts with API access

In this example the SDK will try to fetch data from the discount service.

Make sure to configure the plugin with an API client that only has grants giving access to the public:discounts scope.

<script type="text/javascript">
const container = document.getElementById("checkout-container");
discounts.embed({
container: document.getElementById("deals-container"),
api: {
account: "P00000000",
key: "public_api_key",
secret: "abcdef01-2345-6789-abcd-ef0123456789",
},
theme: {
fontSize: "14px",
color: "rgba(0,0,0,1)",
primary: "hotpink",
secondary: "aqua",
background: "#fff",
},
});
</script>

Installation

For more detailed information about installation click here