2.2.0 • Published 2 months ago

@lemonsqueezy/lemonsqueezy.js v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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

exportmin+brotli
LemonSqueezy (deprecated)1.87 kB
createDiscount928 B
createCheckout821 B
listWebhooks770 B
listSubscriptionInvoices767 B
listDiscountRedemptions766 B
updateSubscription766 B
listLicenseKeyInstances765 B
listSubscriptionItems765 B
listLicenseKeys764 B
listOrderItems764 B
listUsageRecords764 B
listCheckouts763 B
listFiles762 B
listOrders762 B
listPrices762 B
listProducts762 B
listStores762 B
listSubscriptions762 B
listCustomers761 B
listDiscounts761 B
listVariants759 B
createWebhook744 B
updateLicenseKey737 B
updateWebhook728 B
deactivateLicense699 B
validateLicense699 B
activateLicense698 B
createUsageRecord652 B
getLicenseKeyInstance640 B
getDiscountRedemption639 B
getSubscriptionInvoice636 B
getLicenseKey634 B
getOrderItem633 B
getUsageRecord632 B
getWebhook632 B
getCheckout629 B
getSubscription629 B
getStore628 B
getCustomer627 B
getDiscount627 B
getFile627 B
getOrder627 B
getPrice627 B
getProduct627 B
getVariant627 B
updateSubscriptionItem621 B
createCustomer616 B
archiveCustomer615 B
updateCustomer609 B
getSubscriptionItemCurrentUsage592 B
cancelSubscription587 B
deleteWebhook587 B
deleteDiscount585 B
getSubscriptionItem583 B
getAuthenticatedUser529 B
lemonSqueezySetup106 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.

2.2.0

2 months ago

2.1.0

3 months ago

2.0.0

3 months ago

1.2.5

4 months ago

1.2.4

5 months ago

1.2.2

6 months ago

1.2.1

7 months ago

1.2.0

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago