Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Include telegram-web-app.js #314

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/modules/_tonconnect_ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ <h2>Add the return strategy</h2>
<h2>Use inside TMA (Telegram Mini Apps)</h2>
</a>
<p>TonConnect UI will work in TMA in the same way as in a regular website!
Basically, no changes are required from the dApp&#39;s developers. The only thing you have to set is a dynamic return strategy.</p>
Developers need to ensure that the Telegram Mini Apps environment is detected correctly by including the following script inside the header block of your HTML:</p>
<pre><code class="language-html">&lt;header&gt;
&lt;script src="https://telegram.org/js/telegram-web-app.js"&gt;&lt;/script&gt;
&lt;/header&gt;</code></pre>
Basically, no additional changes are required from the dApp&#39;s developers. The only thing you have to set is a dynamic return strategy.</p>
<p>Currently, it is impossible for TMA-wallets to redirect back to previous opened TMA-dApp like native wallet-apps do.
It means, that you need to specify the return strategy as a link to your TMA that will be only applied if the dApp is opened in TMA mode.</p>
<pre><code class="language-ts"><span class="hl-2">tonConnectUI</span><span class="hl-1">.</span><span class="hl-2">uiOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">twaReturnUrl:</span><span class="hl-1"> </span><span class="hl-3">&#39;https://t.me/durov&#39;</span><br/><span class="hl-1">};</span>
Expand Down Expand Up @@ -711,4 +715,4 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="../types/_tonconnect_ui.WalletsModalState.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Wallets<wbr/>Modal<wbr/>State</a></li></ul></nav></div></div>
<div class="container tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>