> For the complete documentation index, see [llms.txt](https://the-swapper-project.gitbook.io/the-swapper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://the-swapper-project.gitbook.io/the-swapper/swap-api/quick-start/set-allowance.md).

# Set Allowance

Before the SWAP transaction, you need to get permission from the user for the amount of tokens equal to the transaction amount.

{% hint style="info" %}
API Key: Ru31BKdr99rGlsyN69
{% endhint %}

<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript"><strong>import Swapper from "swapper"
</strong>
const service = new Swapper({ apiKey: 'YOUR_API_KEY' });

service.setAllowance({
  ownerAddress: '0x123', // your web3 wallet address
  sellTokenAddress: '0x3019bf2a2ef8040c242c9a4c5c4bd4c81678b2a1', // token address to create allowance for
});
</code></pre>
