JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 57
  • Score
    100M100P100Q104892F
  • License MIT

Package Exports

  • ondc-campaign-sdk
  • ondc-campaign-sdk/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ondc-campaign-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ONDC Campaign SDK

The ONDC Campaign SDK is a Node.js library that provides an easy way to fetch live campaign product details. It returns structured data containing campaign information, seller details, and product listings.

🚀 Features

✅ Fetch campaign details like:

  • Campaign name
  • Description
  • Banner image
  • Campaign URL

✅ Fetch product details such as:

  • Seller name
  • Product ID
  • Product name
  • Product image
  • Product price
  • Product category
  • Discount details

📦 Installation

Install the SDK using npm:

npm install ondc-campaign-sdk

🔧 Usage Import the SDK and call fetchLiveCampaignProducts() to get campaign details.

import { fetchLiveCampaignProducts } from "ondc-campaign-sdk";

async function getCampaignProducts() {
    const data = await fetchLiveCampaignProducts();
    console.log("Campaign Data:", data);
}

getCampaignProducts();

API Response Format The function returns a structured response as shown below:

{
    "campaignName": "Mega Discount Sale",
    "description": "Exclusive discounts on top products this season!",
    "banner": "https://example.com/banner.jpg",
    "url": "https://example.com/campaign",
    "products": [
        {
            "sellerName": "ABC Electronics",
            "productId": 101,
            "productName": "Smartphone X",
            "productImage": "https://example.com/product-x.jpg",
            "productPrice": 499.99,
            "category": "Electronics",
            "discount": "10%"
        },
        {
            "sellerName": "XYZ Fashion",
            "productId": 102,
            "productName": "Designer Handbag",
            "productImage": "https://example.com/handbag.jpg",
            "productPrice": 299.99,
            "category": "Fashion",
            "discount": "15%"
        }
    ]
}

🛠 Configuration No additional configuration is required. The SDK works out of the box.

📜 License This project is licensed under the MIT License.

🤝 Contributing We welcome contributions! Feel free to:

Open issues for bugs or feature requests

Submit pull requests with improvements