Telegram login widget
Embed a telegram login button in your svelte application.
Demo
Code
1<script>
2 import { Login } from 'sveltegram';
3</script>
4
5<Login
6 username="ComputlyBot"
7 requestAccess={true}
8 onauth={(data) => { console.log("User ID:", data.id); }}
9/>API
Please refer to Telegram documentation for more details.
usernamerequiredstring—- Your bot username
authTypestringcallback- How to authenticate users? Choices are "callback" or "redirect"
redirectURLstring—- In case you chose
redirectas an authentication method, you must set this property requestAccessbooleanfalse- Whether you want to send messages to the user in the future.
sizestringmedium- Login button size. choices are [small, medium,large]
buttonRadiusnumber10- Login button radius (in pixels)
onauthrequiredFunction—- Callback function responsible for handling successful authentication