0.0.4 • Published 2 years ago

@genki-labs/telegram-login-button v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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 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