npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lazada-iop-client

v1.1.1

Published

Lazada IOP Client SDK for Node JS

Downloads

72

Readme

Lazada IOP SDK for Node JS

Lazada SDK for JavaScript allows you to interact with the Lazada API easily. This SDK supports features such as authentication, sending API requests, and file handling.

Features

  • OAuth2 Authentication: Generate an authentication URL for users to authorize your application.
  • API Requests: Send API requests to the Lazada server with the provided parameters.
  • API Signature: Sign requests for security and data integrity.
  • File Support: Upload files to the Lazada API using FormData.

Installation

To get started, install the following dependencies:

pnpm add axios form-data crypto

Usage

1. Create an Instance of LazadaClient

To begin using this SDK, create an instance of LazadaClient and provide the required parameters.

import LazadaClient from "./LazadaClient";

// Create an instance of LazadaClient
const client = new LazadaClient({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  region: "SG", // Example: 'SG', 'MY', 'VN', etc.
  callbackUrl: "YOUR_REDIRECT_URL",
});

2. Authentication

To get the authentication URL, use makeAuthURL. The user will be directed to this URL to grant access to your app.

const authURL = client.makeAuthURL();
console.log(authURL); // Direct the user to this URL to login

3. Set Access Token

After the user grants permission and your app receives the authorization code, you can set the access token to the LazadaClient instance.

client.setAccessToken("YOUR_ACCESS_TOKEN");

4. Add API Parameters

You can add API parameters that will be used in the API request.

client.addAPIParam("key", "value");
client.addFileParam("file_key", fileBuffer);

5. Execute API Requests

To send an API request to Lazada, use the execute method with the API path and HTTP method.

const response = await client.execute("/path/api", "GET", { key: "value" });
console.log(response);

6. Change Region

If you need to change the region where you want to access the Lazada API, you can do so with the changeRegion method.

client.changeRegion("MY"); // Change to Malaysia

Full Example

import LazadaClient from "./LazadaClient";

const client = new LazadaClient({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  region: "SG",
  callbackUrl: "YOUR_REDIRECT_URL",
});

// 1. Get the authentication URL
const authURL = client.makeAuthURL();
console.log("Redirect the user to the following URL:", authURL);

// 2. After getting the access token, set the token
client.setAccessToken("YOUR_ACCESS_TOKEN");

// 3. Add API parameters
client.addAPIParam("someKey", "someValue");

// 4. Execute the API request
client.execute("/some/api/path", "GET").then((response) => {
  console.log("Response from the API:", response);
});

Directory Structure

project/
│
├── src/
│   └── index.ts       # Main SDK code
├── example.ts         # Example usage of the SDK
├── package.json       # Project and dependencies information
└── tsconfig.json      # TypeScript configuration

Contribution

If you want to contribute, please open a pull request or create an issue for any problems or suggestions.

License

This SDK is licensed under the MIT License.


Make sure to replace placeholders like YOUR_API_KEY, YOUR_API_SECRET, and YOUR_REDIRECT_URL with your actual project information.