React Component to include the Telegram login widget on your website

telegram-login-button

Installation

npm install telegram-login-button

There are also UMD builds available via unpkg:

React Telegram login button

Usage

import React from 'react'
import { render } from 'react-dom'
import TelegramLoginButton, { TelegramUser } from 'telegram-login-button'

render(
  <TelegramLoginButton
    botName="test"
    dataOnauth={(user: TelegramUser) => console.log(user)}
  />,
  document.getElementById('root')
)

API

Props

  • botName - Required | string | your bot username without @.
  • dataOnauth - Required | function | call back on user authentication.
  • usePic - Optional | boolean | show user profile alongside button. defaults to false.
  • className - Optional | string | extra className to override things. defaults to undefined.
  • cornerRadius - Optional | number (in pixel) | radius of the button. defaults to undefined.
  • requestAccess - Optional | boolean | to send messages from your bot. defaults to true.
  • buttonSize - Optional | ‘large’ or ‘medium’ or ‘small’ | button size. defaults to large.

Download Details:

Author: thisisamir98

Source Code: https://github.com/thisisamir98/telegram-login-button

#react #reactjs #javascript

React Component to include the Telegram login widget on your website
21.60 GEEK