jsPelindaJS

A JavaScript client library for interacting with the Panda Development API service.

PelindaJS provides a simple and efficient way to manage license keys, validate users, and track executions for your software applications. Created by @spxnsoarrow-up-right on discord.

Installation

npm install pelindajs

Usage

First, import the PelindaJS class and create a new instance with your API key:

import { PelindaJS } from "pelindajs";

async function main() {
  try {
    const pelinda = await PelindaJS.new("your-api-key-here");
    // Now you can use the pelinda instance
    console.log("PelindaJS initialized successfully!");
  } catch (error) {
    console.error("Failed to initialize PelindaJS:", error.message);
  }
}

main();

API Reference

Initialization

Creates a new PelindaJS instance with the provided API key. This method validates the API key before creating the instance.

Signature:

Parameters:

  • apiKey (string, required): Your Panda Development API key.

Example:


Get Execution Count

Retrieves the current execution count associated with your API key.

Signature:

Example:


Increment Execution Count

Increments the execution count associated with your API key.

Signature:

Example:


Generate Key

Generates new license keys with the specified parameters.

Signature:

Parameters (object):

Parameter
Type
Required?
Description

expire

string

Yes

Expiration date in YYYY-MM-DD format.

note

string

No

An optional note to attach to the key.

count

number

Yes

Number of keys to generate.

isPremium

boolean

Yes

Whether the key is for premium features.

expiresByDaysKey

boolean

No (defaults to false)

Whether the key expires by days.

daysKeys

number

Yes (if expiresByDaysKey is true)

Number of days before expiration.

Example:

Note: The npm documentation had a typo daysKey in the parameter description, but daysKeys in the example. I've used daysKeys based on the example, please verify the correct parameter name.


Delete Key

Deletes an activated key from the system.

Signature:

Parameters (object):

  • keyValue (string, required): The license key value to delete.

Example:


Check Identifier

Checks if an identifier exists in the system and returns service information.

Signature:

Parameters:

  • identifier (string, required): The identifier to check.

Example:


Extend Key Expiration

Extends the expiration date of a key by a specified number of days. (Note: expendKeyExpiration from npm docs, likely meant extendKeyExpiration).

Signature:

Parameters (object):

  • keyValue (string, required): The license key value to extend.

  • days (number, required): The number of days to extend the expiration by.

Example:


Fetch Key

Searches for and retrieves information about a specific key.

Signature:

Parameters:

  • searchTerm (string, required): The key value or other term to search for the key.

Example:


Delete Keyless

Deletes a keyless authentication entry by hardware ID (HWID).

Signature:

Parameters (object):

  • hwid (string, required): The hardware ID associated with the keyless entry to delete.

Example:


Fetch Generated Key

Searches for and retrieves information about a specific generated key (likely before activation/use).

Signature:

Parameters:

  • searchTerm (string, required): The key value or other term to search for the generated key.

Example:


Validate Key

Validates a license key against the service, optionally with a hardware ID (HWID).

Signature:

Parameters:

  1. options (object, required):

    • keyValue (string, required): The license key to validate.

    • service (string, required): The name of your service this key is for.

    • hwid (string, optional): The hardware ID of the user. If not provided, PelindaJS might attempt to use a system-derived HWID (behavior depends on the library's internal implementation or the API).

  2. keylessEnabled (boolean, optional, defaults to false): Whether keyless authentication is enabled for this validation attempt.

Example:

Examples

Complete Example - Key Management Workflow

Error Handling

circle-info

Standard Response Object

All methods in PelindaJS return a promise that resolves to a standard response object with the following structure:

When a request fails (e.g., API error, validation error, network issue), the success property will be false, and the message property will contain details about the error. Always check the success property before attempting to use other data in the response.

License

MIT Licensearrow-up-right

Package: https://www.npmjs.com/package/pelindajsarrow-up-right

Source: https://github.com/spxnso/pelindajsarrow-up-right

Last updated