> For the complete documentation index, see [llms.txt](https://docs.kyberswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kyberswap.com/developer-guide/aggregator-api/how-to-guides/kyberswap-widget/integrating-the-kyberswap-widget.md).

# Integrating The KyberSwap Widget

Superior Rates With Minimal Code

## Installing the Swap Widget

To get started, install the widgets library using npm or Yarn.

#### npm:[​](https://docs.kyberswap.com/Aggregator/swap-widget/getting-started#npm) <a href="#npm" id="npm"></a>

```
npm i @kyberswap/widgets
```

{% embed url="<https://www.npmjs.com/package/@kyberswap/widgets>" %}

#### yarn:[​](https://docs.kyberswap.com/Aggregator/swap-widget/getting-started#yarn) <a href="#yarn" id="yarn"></a>

```
yarn add @kyberswap/widgets
```

## Adding the Swap widget to your app

{% hint style="success" %}
**Note on integrations: clientID**

In order to continuously improve the KyberSwap Widget, our widget implements a `client` field that enables us to understand how the widget swaps are being utilized. As a developer integrating with our widget, **please add your clientID (i.e. company name) to the `client` field** to enable us to serve you better. Refer below for example.
{% endhint %}

Embed the React component in your application with this piece of code:

```
import { Widget } from "@kyberswap/widgets";

<Widget
    client="yourCompanyNameHere"
    theme={theme}
    tokenList={[]}
    enableRoute = true
    enableDexes="kyberswap-elastic,uniswapv3,uniswap"
    provider={ethersProvider}
    defaultTokenOut={defaultTokenOut[chainId]}
    title={<div>Custom Title</div>}
/>
```

That's it! You should now see a fully functional swap widget on your site. You can easily [customize the widget](/developer-guide/aggregator-api/how-to-guides/kyberswap-widget/customizing-the-kyberswap-widget.md) according to your application colors.

## GitHub Repo

{% embed url="<https://github.com/KyberNetwork/kyberswap-interface/tree/main/packages/swap-widgets>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kyberswap.com/developer-guide/aggregator-api/how-to-guides/kyberswap-widget/integrating-the-kyberswap-widget.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
