telegram-api-vue
v1.2.9
Published
Library to access telegram API in VueJs project
Downloads
12
Maintainers
Readme
Telegram Api for Vuejs
Based on TelegramApiJs
Getting started
- Install package via npm
npm install telegram-api-vue
- Import in your
main.js
import telegramApi from './plugins/telegram';
Create file
telegram.js
inplugins
folderPut config in created file
telegram.js
/* You should register your application on https://my.telegram.org/ */
import * as telegramApi from 'telegram-api-vue/dist/telegramApi.min';
telegramApi.setConfig({
app: {
id: 1167695, /* App ID */
hash: 'b5fbdce2ae649419c889c1eb970407bc', /* App hash */
version: '1.0.0' /* App version */
},
server: {
test: [
{
id: 2, /* DC ID */
host: '149.154.167.40',
port: 443
}
],
production: [
{
id: 2, /* DC ID */
host: '149.154.167.50',
port: 443
}
]
}
});
export default telegramApi;
- Check your status
telegramApi.getUserInfo().then(function(user) {
if (user.id) {
// You have already signed in
} else {
// Log in
}
});