# Set up Expanded Checkout (/v5/expanded/get-started)



> **Warning:** **Important:** New integrations should use the [PayPal JavaScript SDK v6](/sdk).
>
> This integration uses the PayPal JavaScript SDK v5, and it's to troubleshoot existing integrations only.

Integrate Expanded Checkout to present custom card fields to your payers so they can pay using your site's branding.

## Prerequisites [#prerequisites]

1. Create a PayPal developer account or log in with a PayPal business account.
2. PayPal uses two development environments: sandbox and production. The sandbox environment is for testing and simulates the live PayPal experience without affecting real money. Get a sandbox client ID and secret to build your integration.

## Set up your development environment in Node.js [#set-up-your-development-environment-in-nodejs]

Take the following steps to set up your development environment in Node.js.

### 1. Build the server [#1-build-the-server]

This sample integration uses the npm package manager.

Navigate to the root folder of your project, then enter npm install to run the sample application. For more information, visit [npm's documentation](https://docs.npmjs.com/).

### 2. Install dependencies [#2-install-dependencies]

In your project root folder, set up your integration by running `npm install @paypal/paypal-server-sdk@1.0.0 dotenv express body-parser` to install the following 4 libraries at the same time:

* [@paypal/paypal-server-sdk@1.0.0](https://www.npmjs.com/package/@paypal/paypal-server-sdk/v/1.0.0) The PayPal Server SDK provides integration access to the PayPal REST APIs.
* [dotenv](https://www.npmjs.com/package/dotenv) separates your configuration and code by loading environment variables from a .env file into process.env.
* [express](https://www.npmjs.com/package/express) is a Node.js web application framework that supports web and mobile applications.
* [body-parser](https://www.npmjs.com/package/body-parser) is used to parse incoming request bodies in a middleware before your handlers

This sample integration uses PayPal's Server SDK v1.0.0. For more details, visit the [PayPal Server SDK documentation](https://developer.paypal.com/serversdk) and log in to your account.

### 3. Verify package.json [#3-verify-packagejson]

The following code sample shows a typical package.json file for a PayPal integration. If you rename your server file from server.js to something else, update the filename references in the package.json script.

```json
{
  "name": "paypal-expanded-integration-backend-node",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "dependencies": {
    "@paypal/paypal-server-sdk": "^1.0.0",
    "body-parser": "^1.20.3",
    "dotenv": "^16.3.1",
    "express": "^4.18.2"
  },
  "scripts": {
    "server-dev": "nodemon server.js",
    "start": "npm run server-dev",
    "prod": "node server.js",
    "format": "npx prettier --write **/*.{js,jsx,md}",
    "format:check": "npx prettier --check **/*.{js,jsx,md}"
  },
  "devDependencies": {
    "concurrently": "^8.2.1",
    "nodemon": "^3.0.1"
  }
}
```

If you have trouble with your app, reinstall your local library and package files using `npm install`.

If you have an error about loading an ES module, add `"type": "module"` in your package.json file. This field isn't automatically added when package.json is created.

### 4. Set up environment variables [#4-set-up-environment-variables]

Store your PayPal client ID and client secret in an .env file at the root of your project:

```bash
PAYPAL_CLIENT_ID=your_app_client_id_here
PAYPAL_CLIENT_SECRET=your_app_client_secret_here
```

The dotenv package loads these values into your app at runtime. Never commit your .env file to version control. Add it to your .gitignore before your first commit.

## Choose a payment option to integrate [#choose-a-payment-option-to-integrate]

PayPal checkout supports one-time payments and recurring payments.

| Payment option     | Description                                                                       |
| :----------------- | :-------------------------------------------------------------------------------- |
| One-time payments  | Buyers can make one-time purchases without manually entering payment information. |
| Recurring payments | Set up automatic payments at regular intervals.                                   |
