> For the complete documentation index, see [llms.txt](https://docs.squidrouter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.squidrouter.com/widget-integration/add-a-widget/stake-widget/importing-the-widget.md).

# Importing The widget

Install dependencies:

```bash
npm i @0xsquid/staking-widget @0xsquid/sdk ethers
```

And import the widget in your app:

```typescript
import { SquidStakingWidget } from "@0xsquid/staking-widget";
import { SquidCallType } from "@0xsquid/sdk";
import { ethers } from "ethers";

import erc20Abi from "./abi/erc20Abi";
import pinjamStakingPoolAbi from "./abi/pinjamStakingPoolAbi";

const pinjamStakingPoolInterface = new ethers.Interface(
  pinjamStakingPoolAbi
);

const kavaId = 2222;
const pinjamAxlUsdcPoolAddress = "0x11c3d91259b1c2bd804344355c6a255001f7ba1e";
const axlUsdcKavaAddress = "0xeb466342c4d449bc9f53a865d5cb90586f405215";
const pAxlUsdcAddress = "0x5c91f5d2b7046a138c7d1775bffea68d5e95d68d";
const erc20Interface = new ethers.Interface(erc20Abi);

export default function App() {
  const stakeConfig = {
    tokensConfig: [
      {
        stakedTokenExchangeRateGetter: async () => {
          return 1;
        },
        unstakeLink: "https://app.pinjamlabs.com/staking",
        customContractCalls: [
          {
            callType: SquidCallType.FULL_TOKEN_BALANCE,
            target: axlUsdcKavaAddress,
            value: "0",
            callData: () => {
              return erc20Interface.encodeFunctionData("approve", [
                pinjamAxlUsdcPoolAddress,
                "0",
              ]);
            },
            payload: {
              tokenAddress: axlUsdcKavaAddress,
              inputPos: 1,
            },
            estimatedGas: "50000",
          },
          {
            callType: SquidCallType.FULL_TOKEN_BALANCE,
            target: pinjamAxlUsdcPoolAddress,
            value: "0",
            callData: (route: any) => {
              if (route.destinationAddress) {
                return pinjamStakingPoolInterface.encodeFunctionData(
                  "deposit",
                  [axlUsdcKavaAddress, "0", route.destinationAddress, true]
                );
              }
              return "0x0000000000000000000000000000000000000000";
            },
            payload: {
              tokenAddress: axlUsdcKavaAddress,
              inputPos: 1,
            },
            estimatedGas: "250000",
          },
        ],

        stakedToken: {
          chainId: kavaId,
          address: pAxlUsdcAddress,
          name: "paxlUSDC",
          symbol: "paxlUSDC",
          decimals: 6,
          logoURI:
            "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389",
          coingeckoId: "usd-coin",
        },
        tokenToStake: {
          chainId: kavaId,
          address: axlUsdcKavaAddress,
        },
        stakingContract: {
          address: "0xe5274e38e91b615d8822e8512a29a16ff1b9c4af",
          explorerLink: "https://kava.mintscan.io/account/",
        },
        logoUrl: "https://app.pinjamlabs.com/icons/pinkav.svg",
      },
    ],

    introPage: {
      title: "Stake paxlUSDC on Kava",
      description: "Stake paxlUSDC on Kava to earn rewards",
    },
  };

  return (
    <SquidStakingWidget
      config={{
        apiUrl: "https://v2.api.squidrouter.com",
        integratorId: "<your integrator id>",
        stakeConfig,
      }}
    />
  );
}
```


---

# 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.squidrouter.com/widget-integration/add-a-widget/stake-widget/importing-the-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.
