> ## 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.

# Overview

> Add Cashfree Element Integration to your web app by loading cashfree.js from sdk.cashfree.com and embedding ready-made, PCI compliant payment components fast.

Cashfree Element Integration makes it easy to add secure payment features to web apps. By including the Cashfree SDK with a simple script tag, developers can use ready-made payment components that are safe and compliant with security standards. These customisable elements can be embedded directly into the app, simplifying the payment process while ensuring flexibility and ease of use. The setup is quick, requiring minimal effort, and ensures a secure, efficient payment experience.

To get started, include the `cashfree.js` library in your website. To be PCI compliant, you must load cashfree.js directly from [https://sdk.cashfree.com](https://sdk.cashfree.com). You cannot include it in a bundle or host it yourself.
To always use a specific version you will have to include the version in this way:

```html theme={"dark"}
<script src="https://sdk.cashfree.com/js/v3/cashfree.js"></script>
```

<Tip>
  If you're using **Svelte** or **React**, refer to the [SDK documentation](/payments/online/element/sdks#svelte-library) for more details.
</Tip>

### Async and deferred loading

Asynchronous loading of JavaScript is generally recommended, as it can improve the user experience of your site by not blocking DOM rendering during script loading.

You can also load cashfree.js using the async or defer attribute on the script tag. Kindly note that with asynchronous loading, any API calls will have to be made only after the script execution has finished.

```javascript theme={"dark"}
const cashfree = Cashfree({
  mode: "sandbox", //or production
});
```

<img src="https://mintcdn.com/cashfreepayments-d00050e9/JZc-JzI9LQpTeTyY/static/payments/custom-web-checkout/overview/element-component-lifecycle.jpg?fit=max&auto=format&n=JZc-JzI9LQpTeTyY&q=85&s=90bbef2784b022662e08dfcc0895990f" alt="Component Lifecycle" width="2968" height="1347" data-path="static/payments/custom-web-checkout/overview/element-component-lifecycle.jpg" />

<div class="hidden mb-4" data-table-of-contents="top">
  <iframe height="150" width="100%" class="shadow-2xl rounded-md" src="https://www.youtube.com/embed/LOXUTo9vWOU?enablejsapi=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

  <a href="https://www.cashfree.com/devstudio/preview/pg/web/card" target="_blank" class="inline-flex items-center justify-center mt-4 p-4 w-full text-base font-medium text-gray-500 rounded-lg bg-gray-50 hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700 dark:hover:text-white">
    <span class="flex items-center gap-2">
      Try it in DevStudio

      <svg width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M14 4H20M20 4V10M20 4L12 12" stroke="#33363F" stroke-width="2" />

        <path d="M11 5H7C5.89543 5 5 5.89543 5 7V17C5 18.1046 5.89543 19 7 19H17C18.1046 19 19 18.1046 19 17V13" stroke="#33363F" stroke-width="2" stroke-linecap="round" />
      </svg>
    </span>
  </a>
</div>

<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/payments/online/element/component-overview">Component Overview</a></li>
    <li><a href="/docs/payments/online/element/sdks">SDK Libraries</a></li>
  </ul>
</div>
