Skip to content

thisisamir98/telegram-login-button

Repository files navigation

telegram-login-button

npm version build status coverage status npm downloads

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 - Optional | function | call back on user authentication.
  • dataAuthUrl - Optional | string | redirect to url 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.

Either dataOnauth or dataAuthUrl should be given. If both are given, it uses dataAuthUrl.

License

MIT

About

React Component to include the Telegram login widget on your website

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •