About Lemon.js

Lemon.js is a lightweight JavaScript library (2.3kB) that seamlessly integrates Lemon Squeezy functionality into your application, allowing you to effortlessly open checkout overlays and more.


Installation

You can get started using Lemon.js by embedding our tiny (2.3kB) library via our CDN into the head or body of your page.

<script src="https://app.lemonsqueezy.com/js/lemon.js" defer></script>

By default, any anchor tag <a> on the page with the class lemonsqueezy-button assigned will, when clicked, open a Lemon Squeezy link. This makes it easy to open a Lemon Squeezy checkout overlay without having to write any JavaScript.

<!-- Somewhere on your page... -->
<a
  class="lemonsqueezy-button"
  href="https://demo.lemonsqueezy.com/checkout/..."
>
  Buy My Amazing Product
</a>

Advanced usage

As a developer, you may want to tightly integrate Lemon Squeezy within the various flows of your application, such as during the registration process.

Lemon.js exposes optional functionality you can use within your application:


Was this page helpful?