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

# Installation

## Prerequisites

Before installing, make sure you have the following:

* [Node.js](https://nodejs.org/) (v16 or higher)
* [npm](https://www.npmjs.com/)
* [Python](https://www.python.org/) (at least 3.8)
* [PHP](https://www.php.net/) (at least 8.1)
* [Composer](https://getcomposer.org/) (for PHP dependency management)

***

## Install the Modem Pay SDK

To get started, install the SDK in your Node.js or Python project:

<CodeGroup>
  ```bash npm theme={null}
  npm install modem-pay
  ```

  ```bash python theme={null}
  pip install modempay
  ```

  ```bash php theme={null}
  composer require modempay/modempay-php
  ```
</CodeGroup>

***

## Initialize the SDK

To authenticate requests, instantiate the SDK with your **Modem Pay secret API key**:

<CodeGroup>
  ```ts typescript theme={null}
  import ModemPay from "modem-pay";

  const modempay = new ModemPay("YOUR_MODEM_PAY_API_KEY");

  const intent = await modempay.paymentIntents.create({ amount: 450 });

  console.log(intent.data.payment_link);
  ```

  ```python python theme={null}
  from modempay import ModemPay

  modem_pay = ModemPay(api_key="YOUR_MODEM_PAY_API_KEY")

  intent = modem_pay.payment_intents.create(params={"amount": 450})

  print(intent["data"]["payment_link"])
  ```

  ```php php theme={null}
  use ModemPay\ModemPay;

  $modemPay = new ModemPay('YOUR_MODEM_PAY_API_KEY');

  $payment = $modemPay->paymentIntents()->create(['amount' => 450]);

  echo $payment->data->payment_link;
  ```
</CodeGroup>

<Warning>
  🔐 Never expose your secret API key on the frontend or in public repositories.
</Warning>

***

## Get Your API Key

1. Log in to [modempay.com](https://merchant.modempay.com).
2. Go to **Developers** → **API Keys**.
3. Generate or copy your secret key.
4. Use this key when initializing the SDK.

***

## (Optional) Install the Modem Pay CLI

For local webhook testing and simulation in a test environment, you can install the CLI globally:

```bash bash theme={null}
npm install -g modem-pay-cli
```

Use `modempay listen` to test webhooks locally and `modempay trigger` to simulate events.

<Tip>
  For full CLI usage, visit the [CLI docs](/documentation/core/webhook-cli).
</Tip>
