Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@juspay/blaze-sdk-web
Advanced tools
Blaze SDK Web is a Javascript library which enables you to seamlessly integrate and use Breeze 1 Click Checkout in your Web app built using any kind of web technology.
Run following command in your node project to install the Blaze SDK Web package:
npm install @juspay/blaze-sdk-web
This will install the Blaze SDK Web package in your project.
Note: You can use pnpm, yarn or any other package manager of your choice to install the package.
To start using the Blaze SDK Web, you need to complete following steps:
To initiate the Blaze SDK Web, you need to call the initiate
method of the SDK. This method takes an object as an argument which contains the following properties:
Parameter | Type | Mandatory | Description |
---|---|---|---|
merchantId | String | Yes | The merchant ID provided by Juspay. |
shopUrl | String | Yes | The URL of the shop where the SDK will be used. |
environment | String | No | The environment in which the SDK should run. Possible values are beta and production . |
shopPlatform | String | Yes | The platform on which the shop is built. Possible values are shopify , magento , woocommerce , custom |
// Import the SDK to your project
import BlazeSDK from '@juspay/blaze-sdk-web';
// Create the initiate payload
const initiatePayload = {
merchantId: '<merchant-id-shared-by-breeze>',
shopUrl: '<shop-url>',
environment: 'production',
shopPlatform: 'custom'
};
BlazeSDK.initiate(initiatePayload);
To process your request through Blaze SDK, you need to call the process
method of the SDK. This method takes an object. Refer below sections to understand the object structure.
Parameter | Type | Mandatory | Description |
---|---|---|---|
action | String | Yes | The action to be performed by the SDK. Possible values are startCheckout |
cart | BlazeCart or String | Yes | The cart object which contains the cart details or Stringified Cart when using signature based integration |
utmParams | Object | No | UTP Parameters associated with the user journey |
signature | String | No | RSA Signed signature for Stringified BlazeCart JSON |
Parameter | Type | Mandatory | Description |
---|---|---|---|
initialPrice | Number | Yes | The initial price of the cart. |
totalPrice | Number | Yes | The total price of the cart. |
totalDiscount | Number | Yes | The total discount applied on the cart. |
weight | Number | No | The total weight of the cart. |
itemCount | Number | Yes | The total number of items in the cart. |
currency | BlazeCurrency | Yes | The currency of the cart. |
items | BlazeCartItem[] | Yes | The array of items in the cart. |
Blaze SDK Web supports the following currencies:
Parameter | Type | Mandatory | Description |
---|---|---|---|
id | String | Yes | The ID of the item. |
title | String | Yes | The title of the item. |
variantTitle | String | No | The variant title of the item. |
variantId | String | No | The variant ID of the item. |
image | String | No | The image URL of the item. |
weight | Number | No | The weight of the item. |
quantity | Number | Yes | The quantity of the item. |
discount | Number | Yes | The discount applied on the item. |
initialPrice | Number | Yes | The initial price of the item. |
finalPrice | Number | Yes | The final price of the item. |
Post you have initiated the SDK, you can call the process
method to execute your query.
// Import your SDK
import BlazeSDK from '@juspay/blaze-sdk-web';
// Creating process payload
const processPayload = {
action: 'startCheckout',
cart: {
initialPrice: 1000,
totalPrice: 900,
totalDiscount: 100,
weight: 1000,
itemCount: 2,
currency: 'INR',
items: [
{
id: '1',
title: 'Item 1',
variantTitle: 'Variant 1',
variantId: '1',
image: 'https://example.com/image1.jpg',
weight: 500,
quantity: 1,
discount: 50,
initialPrice: 500,
finalPrice: 450
},
{
id: '2',
title: 'Item 2',
variantTitle: 'Variant 2',
variantId: '2',
image: 'https://example.com/image2.jpg',
weight: 500,
quantity: 1,
discount: 50,
initialPrice: 500,
finalPrice: 450
}
]
},
utmParams: {
utm_source: 'google',
utm_medium: 'cpc',
utm_campaign: 'summer-sale'
}
};
BlazeSDK.process(processPayload);
Note: This SDK is in alpha stage. Expect new features & breaking changes in upcoming versions.
FAQs
SDK for integrating Breeze 1CCO into your Web Application
We found that @juspay/blaze-sdk-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.