Search code examples
telegramtelegram-api

Telegram login widget not showing up


Sorry I am a total newb. I deployed this site https://visionary-cupcake-b69c3d.netlify.app/

  1. used this part of the code for the test
    </script>
    <!-- Start of the added Telegram script -->
  <script async src="https://telegram.org/js/telegram-widget.js?22" data-telegram-login="Guardian200_bot" data-size="large" data-auth-url="ya.ru"></script>
    </script>
    <!-- End of the added Telegram script -->
  1. my bot is regstered and I specifiyed [visionary-cupcake-b69c3d.netlify.app] as a domain
  2. site is using https as required

Yet login widget is not showing up. Why it could be?

I redeployed it few times, checked various settings from there https://core.telegram.org/widgets/login to no avail


Solution

  • It seems like you have put the <script> tag inside the <head>. Put it somewhere inside the <body>, so it can be displayed when the button component is created.

    <body>
        <div class="content">
            <!-- your app -->
            <!-- the script tag provided by Telegram wherever you want the button to be --->
        </div>
    </body>