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

@lemonsqueezy/lemonsqueezy.js

v2.2.0

Published

The official Lemon Squeezy JavaScript SDK.

Downloads

22,206

Readme

The official Lemon Squeezy JavaScript SDK

NPM version Functions usage APIs Count Weekly downloads

Introduction

This is the official JavaScript SDK for Lemon Squeezy, helping make it easy to incorporate billing into your JavaScript application.

Features

Installation

Install the package

# bun
bun install @lemonsqueezy/lemonsqueezy.js
# pnpm
pnpm install @lemonsqueezy/lemonsqueezy.js
# npm
npm install @lemonsqueezy/lemonsqueezy.js

Create an API key

Create a new API key from Settings > API in your Lemon Squeezy dashboard.

Add this API key into your project, for example as LEMONSQUEEZY_API_KEY in your .env file.

Using the API in test mode

You can build and test a full API integration with Lemon Squeezy using test mode.

Any API keys created in test mode will interact with your test mode store data.

When you are ready to go live with your integration, make sure to create an API key in live mode and use that in your production application.

Usage

lemonSqueezySetup({ apiKey });

const { data, error, statusCode } = await getAuthenticatedUser();

console.log({ data, error, statusCode });

For more functions usage, see Wiki.

Bundle size

| export | min+brotli | | :------------------------------ | ---------: | | LemonSqueezy (deprecated) | 1.87 kB | | createDiscount | 928 B | | createCheckout | 821 B | | listWebhooks | 770 B | | listSubscriptionInvoices | 767 B | | listDiscountRedemptions | 766 B | | updateSubscription | 766 B | | listLicenseKeyInstances | 765 B | | listSubscriptionItems | 765 B | | listLicenseKeys | 764 B | | listOrderItems | 764 B | | listUsageRecords | 764 B | | listCheckouts | 763 B | | listFiles | 762 B | | listOrders | 762 B | | listPrices | 762 B | | listProducts | 762 B | | listStores | 762 B | | listSubscriptions | 762 B | | listCustomers | 761 B | | listDiscounts | 761 B | | listVariants | 759 B | | createWebhook | 744 B | | updateLicenseKey | 737 B | | updateWebhook | 728 B | | deactivateLicense | 699 B | | validateLicense | 699 B | | activateLicense | 698 B | | createUsageRecord | 652 B | | getLicenseKeyInstance | 640 B | | getDiscountRedemption | 639 B | | getSubscriptionInvoice | 636 B | | getLicenseKey | 634 B | | getOrderItem | 633 B | | getUsageRecord | 632 B | | getWebhook | 632 B | | getCheckout | 629 B | | getSubscription | 629 B | | getStore | 628 B | | getCustomer | 627 B | | getDiscount | 627 B | | getFile | 627 B | | getOrder | 627 B | | getPrice | 627 B | | getProduct | 627 B | | getVariant | 627 B | | updateSubscriptionItem | 621 B | | createCustomer | 616 B | | archiveCustomer | 615 B | | updateCustomer | 609 B | | getSubscriptionItemCurrentUsage | 592 B | | cancelSubscription | 587 B | | deleteWebhook | 587 B | | deleteDiscount | 585 B | | getSubscriptionItem | 583 B | | getAuthenticatedUser | 529 B | | lemonSqueezySetup | 106 B |

Notes

Do not use this package directly in the browser, as this will expose your API key. This would give anyone full API access to your Lemon Squeezy account and store(s). For more information, see more.

Contributing

See the Contributing Guide.