0.3.0 • Published 6 months ago

@crayond_dev/pasm-sdk v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

PasmClient

Description

PasmClient is an npm package that provides a client SDK for working with the PASM (Plan and Subscription Management) service. It allows you to interact with the service and check the validity of subscriptions based on provided customer information.

Installation

To install PasmClient, you can use npm or yarn:

npm install @crayond_dev/pasm-sdk

# or

yarn add @crayond_dev/pasm-sdk

Usage

Importing PasmClient

import PasmClient from "@crayond_dev/pasm-sdk";

Creating an Instance

To create an instance of PasmClient,

const params = {
  customer_id: "<YOUR_CUSTOMER_ID_HERE>", // Replace with your customer_id
};

const pasmClient = new PasmClient(params);

Checking Subscription Validity

The PasmClient class exposes a method called isValidSubscription, which allows you to check the validity of the subscription for the provided customer.

pasmClient.isValidSubscription()
  .then((isValid) => {
    console.log(`Is the subscription valid? ${isValid}`);
  })
  .catch((error) => {
    console.error("Error while checking subscription validity:", error);
  });
0.3.0

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago