All Projects → vchaptsev → vue-telegram-login

vchaptsev / vue-telegram-login

Licence: MIT license
Vue component for Telegram login

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-telegram-login

xcrop
Mobile image cropping component - Vue React 移动端裁剪组件
Stars: ✭ 27 (-63.01%)
Mutual labels:  vue-component
vstx-data-table
A data table component for the Vue Stacks Ecosystem
Stars: ✭ 34 (-53.42%)
Mutual labels:  vue-component
vue-pattern-input
Use RegExp to limit input
Stars: ✭ 25 (-65.75%)
Mutual labels:  vue-component
vue-component-devtool
Vue 组件开发模板
Stars: ✭ 32 (-56.16%)
Mutual labels:  vue-component
ui-nuclear-mobile
A configurable Mobile UI based on Antd Mobile and Vue
Stars: ✭ 61 (-16.44%)
Mutual labels:  vue-component
vue-eva-input
A beautiful input component based on Eva Design System and Vue.
Stars: ✭ 17 (-76.71%)
Mutual labels:  vue-component
vue-burger-button
🍔 vue-burger-button is a functional component, which is faster than a regular component, and is pretty small (JS min+gzip is lower than 700b and CSS min+gzip is lower than 400b).
Stars: ✭ 41 (-43.84%)
Mutual labels:  vue-component
vue-circle-choice
A circle color choice and navigation with Vue.js
Stars: ✭ 20 (-72.6%)
Mutual labels:  vue-component
vue-snowf
Snowfall component for Vue.js, let it snow on your page! ❄ demo: https://fuxy526.github.io/snowf/
Stars: ✭ 38 (-47.95%)
Mutual labels:  vue-component
vue-drag-zone
Drag Zone component for @vuejs
Stars: ✭ 127 (+73.97%)
Mutual labels:  vue-component
vue-img-orientation-changer
A vue plugin that can help you display image in correct orientation.
Stars: ✭ 38 (-47.95%)
Mutual labels:  vue-component
shadow
Shadow dom support for Vue
Stars: ✭ 46 (-36.99%)
Mutual labels:  vue-component
vue-input-contenteditable
The same features you expect from `<input type="text">` but in a `contenteditable` Vue component
Stars: ✭ 19 (-73.97%)
Mutual labels:  vue-component
vue-collapse
A simple collapse component for Vue.js
Stars: ✭ 34 (-53.42%)
Mutual labels:  vue-component
vue-odometer
Vue.js(v2.x+) component wrap for Odometer.js
Stars: ✭ 63 (-13.7%)
Mutual labels:  vue-component
vue-crop
[举个例子]https://codesandbox.io/s/910ro8ym9r [演示链接(戳我直达)]http://www.wwwwxy.top/html/blg/
Stars: ✭ 38 (-47.95%)
Mutual labels:  vue-component
vue-share-it
A Vue.js component for sharing links to social networks
Stars: ✭ 21 (-71.23%)
Mutual labels:  vue-component
vue-ele-import
超简单、好用的 element-ui Excel 导入组件
Stars: ✭ 50 (-31.51%)
Mutual labels:  vue-component
vue-loading
Loading bar for Vue.js apps using axios
Stars: ✭ 19 (-73.97%)
Mutual labels:  vue-component
v-owl-carousel
🦉 VueJS wrapper for Owl Carousel
Stars: ✭ 46 (-36.99%)
Mutual labels:  vue-component

Vue Telegram Login




vue-telegram-login is a Vue component for Telegram Login

Installation

Install with yarn:

$ yarn add vue-telegram-login

Install with npm:

$ npm i vue-telegram-login --save

or if you just want to try it out, unpkg has ready-to-use packages.

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-telegram-login"></script>

Usage

Import vue-telegram-login, pass it to the components and use in your template

<template>
  
  <!-- Callback mode -->
  <vue-telegram-login 
    mode="callback"
    telegram-login="YourTelegramBot"
    @callback="yourCallbackFunction" />
  
  <!-- Redirect mode -->
  <vue-telegram-login 
    mode="redirect"
    telegram-login="YourTelegramBot"
    redirect-url="https://your-website.io" />

</template>

<script>
import {vueTelegramLogin} from 'vue-telegram-login'

export default {
  name: 'your-component',
  components: {vueTelegramLogin},
  methods: {
    yourCallbackFunction (user) {
      // gets user as an input
      // id, first_name, last_name, username,
      // photo_url, auth_date and hash
      console.log(user)
    }
  }
}
</script>

Props

You can play around with options on the official widget page

Name Description Required Default
mode 'callback' or 'redirect' True null
telegramLogin Your telegram bot name True null
@callback Your callback function, it will be called after success if mode is 'callback' False true
redirectUrl Your redirect URL, user will be redirected if mode is 'redirect' False null
requestAccess 'write' if you want to get access to send messages from your bot False 'read'
size 'large', 'medium' or 'small' False 'large'
userpic Show user photo, true or false False true
radius Button corner radius (default depends on chosen size) False 20\14\10

Notes

  1. You need to set domain to your bot if you want to user Telagram Login (/setdomain command to @BotFather)
  2. You need to verify the authentication and the integrity of the data received by comparing the received hash parameter with the hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the SHA256 hash of the bot's token used as a secret key (source).
    You can find some code samples on this page.
  3. Don't disable third party cookies if you want to use Telegram Login as a User (thanks @robverhoef)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].