# Quick Start

The Quick Start section is intended to give you a preview of the implementations of Squid's SDK, API, and Widget.

Remember you must have an [**integrator-id**](https://squidrouter.typeform.com/integrator-id?typeform-source=app.gitbook.com) **to be able to implement one of these applications.**

{% tabs %}
{% tab title="SDK" %}
Example of a cross-chain swap from Avalanche-AVAX to Polygon-MATIC.

First, install the Squid SDK and Squid types:

<pre class="language-typescript"><code class="lang-typescript"><strong>npm i @0xsquid/sdk@2.8.0-beta.0 @0xsquid/squid-types # 2.8.0-beta.0 
</strong></code></pre>

```typescript
import { Squid } from "@0xsquid/sdk"
import { ethers } from "ethers"
const userAddress = "<your address>"
const integratorId = "<your integrator id>"
const squid = new Squid({
  baseUrl: "https://v2.api.squidrouter.com",
  integratorId: integratorId
})
// initialize the Squid client
await squid.init()
const { route } = await squid.getRoute({
  fromChain: "43114", // Avalanche
  fromAmount: "10000000000000000", // 0.1 AVAX
  fromToken: "0xEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  toChain: "137", // Polygon
  toToken: "0xEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  fromAddress: userAddress,
  toAddress: userAddress,
  slippageConfig: {
autoMode: 1 }
})
const privateKey = "<your private key>"
const rpcUrl = "https://avalanche.drpc.org" // fromChain RPC URL
const provider = new ethers.JsonRpcProvider(rpcUrl)
const signer = new ethers.Wallet(privateKey, provider)
const result = await squid.executeRoute({
  route,
signer })
console.log(result)

```

{% endtab %}

{% tab title="API" %}
Example for getting a route from Avalanche-AVAX to Polygon-MATIC:

```typescript
const integratorId = "<your-integrator-id>"
const userAddress = "<your-address>"
const result = await fetch("https://v2.api.squidrouter.com/v2/route",
  method: "POST",
  body: JSON.stringify({
    fromChain: 43114, // Avalanche
    toChain: 137, // Polygon
    fromToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    toToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    fromAmount: "100000000000000000", // 0.1 AVAX
    fromAddress: userAddress,
    toAddress: userAddress,
    slippageConfig: {
autoMode: 1 }
  }),
  headers: {
    "x-integrator-id": integratorId,
    "Content-Type": "application/json"
  }
})
const route = await result.json()
console.log(route)
```

{% endtab %}

{% tab title="Widget" %}
Install the Squid Widget React component:

```
npm i @0xsquid/widget
```

And import it in your app:

```typescript
import { SquidWidget } from "@0xsquid/widget"
export default function App() {
  const config = {
    companyName: "Squid Widget",
    integratorId: "<your integrator id>",
    slippage: 1,
    instantExec: true,
    infiniteApproval: false,
    apiUrl: "https://api.squidrouter.com",
  } as AppConfig;
  return <SquidWidget config={config} />
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.squidrouter.com/old-v2-documentation-deprecated/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
