> For the complete documentation index, see [llms.txt](https://ton-play-1.gitbook.io/ton-play-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ton-play-1.gitbook.io/ton-play-1/digital-assets-api/connect-wallet.md).

# Connect Wallet

#### ***How to authorize users via Tonkeeper wallet?***

If you want users to connect a wallet via your bot, use the link:

{% code overflow="wrap" %}

```
https://tonapi.io/login?app=085f941afd4dedddda03cc8708b17c3db6fd9acedf2593117debbc71019a047a353632&callback_url=https://web.api.tonplay.io/auth/v1/tonkeeper?uid=<TONPLAY_UserID> 
```

{% endcode %}

where `<TONPLAY_UserID>` is a unique user identifier in TON Play.

***How to redirect users to the game?***

If you want to redirect the user somewhere else after successful authorization, you should add a query parameter

```yaml
&return_url=<YOUR_RESOURCE_URL>
```

So the full authorization link looks like this:&#x20;

{% code overflow="wrap" %}

```
https://tonapi.io/login?app=085f941afd4dedddda03cc8708b17c3db6fd9acedf2593117debbc71019a047a353632&callback_url=https://web.api.tonplay.io/auth/v1/tonkeeper?uid=<TONPLAY_UserID>&return_url=<YOUR_URL>
```

{% endcode %}

***How to get\*\*\*\* ****`<TONPLAY_UserID>`**** \*\*\*\*?***

1. Use [Auth API](/ton-play-1/digital-assets-api/auth-api.md) method to login user on TON Play
2. You will [Get JWT](/ton-play-1/digital-assets-api/authentication/get-jwt.md)&#x20;
3. Decode this token and use `sub` as `<TONPLAY_UserID>`
