> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spotflow.one/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> InlineJS is Spotflow's JavaScript library designed to simplify the integration of payment functionalities into your web application. By embedding InlineJS into your checkout page, you can create a seamless payment experience without the need for redirects. It integrates smoothly into your application, providing a streamlined checkout experience.

## Browser Support

Spotflow InlineJS is compatible with all recent versions of modern web browsers that support ECMAScript 5 or later. This includes:

#### Supported Browsers

* **Google Chrome**: Version 23 and above (all platforms)
* **Safari**: Version 7 and above (macOS and iOS)
* **Mozilla Firefox**: Version 21 and above (desktop)
* **Microsoft Edge**: Version 79 and above (Chromium-based, desktop)
* **Opera**: Version 15 and above (desktop)

#### Mobile Browsers

* **Chrome Mobile**: Android 5.0+
* **Safari Mobile**: iOS 10+
* **Samsung Internet**: Version 4.0+

### Unsupported Browsers

The following browsers and configurations are not supported:

* **Internet Explorer (all versions, including IE 11)**
* **Opera Mini in Super Saver/Extreme mode**
* **Browsers with JavaScript disabled**
* **Legacy browsers that do not support ECMAScript 5**

### Recommendations

For the best experience, we recommend using the latest stable version of any supported browser with JavaScript enabled.

## Installation

<Tabs>
  <Tab title="npm">
    ```JavaScript theme={null}
    npm install @spot-flow/checkout-inline-js 
    ```
  </Tab>

  <Tab title="yarn">
    ```JavaScript theme={null}
    yarn add @spot-flow/checkout-inline-js 
    ```
  </Tab>

  <Tab title="cdn">
    ```JavaScript theme={null}
    <script src="https://dr4h9151gox1m.cloudfront.net/dist/checkout-inline.js"></script>
    ```
  </Tab>
</Tabs>

If you used `NPM` or `Yarn`, ensure you import the library as shown below:

```JavaScript theme={null}
   // Add for NPM, Yarn
import { CheckoutForm } from "@spot-flow/checkout-inline-js";
```

## Usage

### One Time Payment

```JavaScript lines theme={null}
import { CheckoutForm } from "@spot-flow/checkout-inline-js";

const checkout = new CheckoutForm({});
checkout.setup({
  email: "temi@mailinator.com",
  encryptionKey: "gF1SPEMA3ido2Dg4ByXxxxxxxxxxxxxxxxxx", // The encryption key for the merchant
  merchantKey: "pk_test_8a586f9801254xxxxxxxxxxxx", // Your Merchant Public Key generated on Spotflow
  currency: "NGN", //can be in USD or in the local currency of your collection region e.g NGN, GHS
  localCurrency: "NGN", //optional and only needed if currency is in USD
  amount: 500
});
```

### Subscription Payment

```JavaScript lines theme={null}
  const checkout = new CheckoutForm({});
  checkout.setup({
    email: "temi@mailinator.com",
    encryptionKey: "gF1SPEMA3ido2Dg4ByXxxxxxxxxxxxxxxxxx", // The encryption key for the merchant
    merchantKey: "pk_test_8a586f9801254xxxxxxxxxxxx", // Your Merchant Public Key generated on Spotflow
    planId: "7447a235-9f53-4d44-xxxxxxxxxxxxxx", // Replace with your plan ID
    currency: "NGN", //can be in USD or in the local currency of your collection region e.g NGN, GHS
    localCurrency: "NGN", //optional and only needed if currency is in USD
  });
```

### One-Time Payment via CDN

Alternatively, to integrate InlineJS into your web application, you can include it directly in your HTML via a CDN. Include the following script tag in the `<head>` section of your HTML file:

**HTML**

```HTML theme={null}
  <script src="https://dr4h9151gox1m.cloudfront.net/dist/checkout-inline.js"></script>
```

```JavaScript lines theme={null}
 <button onclick="openCheckout()">
  Make Payment
</button>
```

```JavaScript lines theme={null}
 <script>
      const openCheckout = () => {
        const { CheckoutForm } = SpotflowCheckout
      const checkout = new CheckoutForm({});
      checkout.setup({
          email: "temi@mailinator.com",
         encryptionKey: "gF1SPEMA3xxxxxxxxxxxxx", // The encryption key for the merchant
         merchantKey: "pk_test_8a586f9801254xxxxxxxxxxxx", // Your Merchant Public Key generated on Spotflow
         currency: "NGN",
         localCurrency: "NGN", //optional and only needed if currency is in USD
         amount: 500
          }
        });
      };
    </script>
```
