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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bebity.io/hyperline-nodejs-client

v1.0.5

Published

The Hyperline Client Library, built with NestJs offers a full suite of functionalities for SaaS platforms, enabling efficient management of billing, customer data, subscriptions, and more. It supports promise-based and observable-based programming styles.

Downloads

10

Readme

Hyperline Node.js Client

enter image description here The Hyperline Client Library offers a full suite of functionalities for SaaS platforms, enabling efficient management of billing, customer data, subscriptions, and more. It supports promise-based and observable-based programming styles. Hyperline documentation

Setup and Initialization

Install

NPM: https://www.npmjs.com/package/@bebity.io/hyperline-nodejs-client

npm install @bebity.io/hyperline-nodejs-client
pnpm install @bebity.io/hyperline-nodejs-client
yarn add @bebity.io/hyperline-nodejs-client

With function

Initialize the client using create_hyperline_client function, which requires an object of type HyperlineClientOptions.

const client = await create_hyperline_client(options);

In a RxJS Container

In an RxJS environment like NestJS, you can inject the module into your imports for full access to all repositories.

@Module({
  imports: [HyperlineClientModule.forRoot(options)],
})

Library Options

HyperlineClientOptions type definition:

type HyperlineClientOptions = {
  api_key: string;
  events_ingestion_api_auth?: { // required for use events_ingestion_api
    username: string;
    password: string;
  };
  environment: "sandbox"  |  "production"  |  ApiEnvironment;
};

Method Response Types

All methods return a promise and an observable.

Promise Usage

const response = client.customers.list();
const data = await response.promise();

Observable Usage

const response = client.customers.list();
response.observable.subscribe(data => {
  console.log(data);
});

Feature Documentation

Customers Repository

Create Customer

const input: Customer.CreateInput = { /* Customer data */ };
const new_customer = await client.customers.create(input).promise();

Retrieve Customer

const customer = await client.customers.get('CUSTOMER_ID').promise();

Update Customer

const input: Customer.UpdateInput = { /* Updated customer data */ };
const updated_customer = await client.customers.update('CUSTOMER_ID', input).promise();

List Customers

const customers = await client.customers.list(/* Optional filters */).promise();

Archive Customer

const archived_customer = await client.customers.archive('CUSTOMER_ID').promise();

Companies Repository

List company information.

const companies = await client.companies.list().promise();

Coupons Repository

Create Coupon

const input: Coupon.CreateInput = { /* Coupon data */ };
const new_coupon = await client.coupons.create(input).promise();

Retrieve Coupon

const coupon = await client.coupons.get('COUPON_ID').promise();

Update Coupon

const input: Coupon.UpdateInput = { /* Updated coupon data */ };
const updated_coupon = await client.coupons.update('COUPON_ID', input).promise();

List Coupons

const coupons = await client.coupons.list(/* Optional filters */).promise();

Delete Coupon

const deleted_coupon = await client.coupons.delete('COUPON_ID').promise();

Integrations Repository

Create tokens for integration components.

const token = await client.integrations.create_component_token('CUSTOMER_ID').promise();

Products Repository

Create Product

const input: Product.CreateInput = { /* Product data */ };
const product = await client.products.create(input).promise();

Retrieve Product

const product = await client.products.get('PRODUCT_ID').promise();

Update Product

const input: Product.UpdateInput = { /* Updated product data */ };
const updated_product = await client.products.update('PRODUCT_ID', input).promise();

List Products

const products = await client.products.list(/* Optional filters */).promise();

Invoices Repository

Create One-Off Invoice

const input: Invoice.CreateOneOffInput = { /* Invoice data */ };
const invoice = await client.invoices.create_one_off(input).promise();

Retrieve Invoice

const invoice = await client.invoices.get('INVOICE_ID').promise();

List Invoices

const invoices = await client.invoices.list(/* Optional filters */).promise();

Download Invoice

const invoice = await client.invoices.download('INVOICE_ID', 'Path/to/save').promise();

Payments Repository

Create Payment

const input: Payment.CreateInput = { /* Payment data */ };
const payment = await client.payments.create(input).promise();

Plans Repository

Retrieve and list plans.

Retrieve Plan

const plan = await client.plans.get('PLAN_ID').promise();

Price Configurations Repository

Update Price Configurations

const input: PriceConfiguration.UpdatePricesInput = { /* Price configuration data */ };
const price_configuration = await client.price_configurations.update_prices('PRICE_CONFIGURATION_ID', input).promise();

Subscriptions V2 Repository

Create Subscription

const input: SubscriptionV2.CreateInput = { /* Subscription data */ };
const subscription = await client.subscriptions_v2.create(input).promise();

Retrieve Subscription

const subscription = await client.subscriptions_v2.get('SUBSCRIPTION_ID').promise();

Third Party Apps Repository

Create App

const input: Third Party App.CreateInput = { /* App data */ };
const app = await client.third_party_integrations.create(input).promise();

Wallets Repository

Create Wallet

const input: Wallet.CreateInput = { /* Wallet data */ };
const wallet = await client.wallets.create(input).promise();

Retrieve Wallet

const wallet = await client.wallets.get('WALLET_ID').promise();

Webhooks Repository

Retrieve webhook messages.

const messages = await client.webhooks.get_messages().promise();

Conclusion

The Hyperline Client Library, with its comprehensive and flexible architecture, serves as an essential tool for SaaS platforms to interact with Hyperline's billing API. Developed and maintained by Bebity.io, it stands as a testament to modern, efficient API integration in the Node.js ecosystem. enter image description here