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

# Server Side SDKs

> Install and configure Cashfree Secure ID server SDKs for Node.js, Java, Python, and PHP to call KYC and verification APIs without writing low-level REST code.

Cashfree Secure ID server-side SDKs reduce the amount of work required to call Secure ID REST APIs from your backend. Each SDK wraps authentication, request formatting, and response parsing in language-specific libraries for Node.js, Java, Python, and PHP.

## Prerequisites

Complete the following before you install an SDK:

* Generate API keys and confirm your sandbox credentials. See [Getting started](/docs/api-reference/vrs/getting-started).
* Whitelist your server IP address, or configure 2FA signature generation for API requests.

## API vs SDK

Use the REST API when you need full control over HTTP requests, work in a language without an official SDK, or call only a small set of endpoints. Use an SDK when you want language-native methods, built-in authentication headers, and less boilerplate for request and response handling.

An API defines how applications send requests and receive responses, typically over a network. An SDK packages APIs with libraries, documentation, and language-specific helpers so you can call those APIs with less manual setup.

The following table compares the two approaches:

| Aspect           | API                                 | SDK                                                    |
| ---------------- | ----------------------------------- | ------------------------------------------------------ |
| Purpose          | Enables interaction between systems | Facilitates application development                    |
| Scope            | Focused on specific functionality   | Toolkit that often includes APIs                       |
| Ease of use      | Requires manual setup               | Provides abstractions and ready-to-use code            |
| Language support | Typically language-agnostic         | Usually language-specific                              |
| Included tools   | None                                | Often includes helpers, samples, and related utilities |

## Why use server SDKs

Server SDKs help you integrate Secure ID verification APIs faster and with fewer errors than calling REST endpoints directly. They offer the following benefits:

* **Faster integration**: Pre-built methods map to Secure ID API operations, so you spend less time writing HTTP clients and parsing JSON.
* **Built-in authentication**: SDKs attach required headers such as `x-client-id`, `x-client-secret`, and `x-api-version` on every request.
* **Consistent error handling**: API error responses are surfaced as language-native exceptions or error objects, so you do not parse HTTP status codes manually.
* **Type safety**: Request and response models in Java and PHP help catch parameter mistakes at compile time.
* **Ongoing maintenance**: SDK releases track API changes, reducing the effort required to adopt new endpoints or fields.

## Supported SDKs

Cashfree maintains official server-side SDKs for the following languages. Each card links to the SDK GitHub repository for source code, changelogs, and issue tracking.

<CardGroup cols={2}>
  <Card title="Node.js SDK" icon="node-js" href="https://github.com/cashfree/cashfree-verification-sdk-nodejs">
    Version **4.0.1**. JavaScript and TypeScript SDK for Node.js applications and serverless functions.
  </Card>

  <Card title="Java SDK" icon="java" href="https://github.com/cashfree/cashfree-verification-sdk-java">
    Version **2.0.10**. SDK for Java applications and Spring Boot services.
  </Card>

  <Card title="Python SDK" icon="python" href="https://github.com/cashfree/cashfree-verification-sdk-python">
    Version **2.0.0**. SDK for Python applications and data pipelines.
  </Card>

  <Card title="PHP SDK" icon="php" href="https://github.com/cashfree/cashfree-verification-sdk-php">
    Version **3.0.1**. SDK for PHP applications and Laravel projects.
  </Card>
</CardGroup>

## Install and configure the SDK

Select your language below, install the package, and initialise the SDK with your credentials and target environment.

<Tabs>
  <Tab title="Node.js">
    Install the package using npm:

    ```bash theme={"dark"}
    npm install cashfree-verification
    ```

    Initialise the SDK with your client ID, client secret, API version, and environment:

    ```javascript theme={"dark"}
    import { Cashfree } from "cashfree-verification";

    Cashfree.XClientId = "<CLIENT_ID>";
    Cashfree.XClientSecret = "<CLIENT_SECRET>";
    Cashfree.XEnvironment = Cashfree.Environment.SANDBOX;
    Cashfree.XApiVersion = "2024-12-01";
    ```
  </Tab>

  <Tab title="Java">
    Add the dependency to your build file.

    Gradle dependency:

    ```gradle theme={"dark"}
    implementation "com.cashfree.verification.java:cashfree_verification:2.0.10"
    ```

    Maven dependency:

    ```xml theme={"dark"}
    <dependency>
      <groupId>com.cashfree.verification.java</groupId>
      <artifactId>cashfree_verification</artifactId>
      <version>2.0.10</version>
    </dependency>
    ```

    Initialise the SDK:

    ```java theme={"dark"}
    import com.cashfree.CashfreeVrs;

    CashfreeVrs.XClientId = "<CLIENT_ID>";
    CashfreeVrs.XClientSecret = "<CLIENT_SECRET>";
    CashfreeVrs.XEnvironment = CashfreeVrs.SANDBOX;

    CashfreeVrs cashfree = new CashfreeVrs();
    String xApiVersion = "2024-12-01";
    ```
  </Tab>

  <Tab title="Python">
    Install the package using pip:

    ```bash theme={"dark"}
    pip install cashfree_verification
    ```

    Initialise the SDK:

    ```python theme={"dark"}
    from cashfree_verification import Cashfree

    Cashfree.XClientId = "<CLIENT_ID>"
    Cashfree.XClientSecret = "<CLIENT_SECRET>"
    Cashfree.XEnvironment = Cashfree.SANDBOX
    x_api_version = "2024-12-01"
    ```
  </Tab>

  <Tab title="PHP">
    Install the package using Composer:

    ```bash theme={"dark"}
    composer require cashfree/cashfree-verification
    ```

    Initialise the SDK:

    ```php theme={"dark"}
    \Cashfree\CashfreeVrs::$XClientId = "<CLIENT_ID>";
    \Cashfree\CashfreeVrs::$XClientSecret = "<CLIENT_SECRET>";
    \Cashfree\CashfreeVrs::$XEnvironment = \Cashfree\CashfreeVrs::$SANDBOX;

    $cashfree = new \Cashfree\CashfreeVrs();
    ```
  </Tab>
</Tabs>

<Warning>
  Do not embed your client secret in client-side code, mobile applications, or public repositories. Initialise SDKs only on trusted backend servers.
</Warning>

<div class="hidden" data-table-of-contents="bottom">
  <p class="mt-4 font-medium flex items-center gap-2 related-docs-heading">
    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="w-4 h-4">
      <path d="M3 4h7a2 2 0 0 1 2 2v13a2 2 0 0 0-2-2H3z" />

      <path d="M21 4h-7a2 2 0 0 0-2 2v13a2 2 0 0 1 2-2h7z" />
    </svg>

    <span>Related topics</span>
  </p>

  <ul>
    <li><a href="/docs/api-reference/vrs/v2/bav-v2/bank-account-verification-sync-v2">Bank Account Verification Sync V2 API</a></li>
    <li><a href="/docs/api-reference/vrs/v2/pan/pan-lite">PAN Lite API</a></li>
    <li><a href="/docs/api-reference/vrs/v2/ifsc/ifsc-verification-v2">IFSC Verification V2 API</a></li>
    <li><a href="/docs/api-reference/vrs/v2/digilocker/digilocker-sdk">DigiLocker React Native SDK</a></li>
  </ul>
</div>
