Socket
Socket
Sign inDemoInstall

telegram-api-js

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    telegram-api-js

JavaScript library for using Telegram API.


Version published
Weekly downloads
19
increased by1800%
Maintainers
1
Install size
968 kB
Created
Weekly downloads
 

Readme

Source

TelegramApi

Based on webogram

Getting started

  1. Install package via npm
npm install telegram-api-js

Or bower

bower install telegram-api-js
  1. Add a <script> to your index.html
<html>
<head>
    <title>My amazing app</title>
</head>
<body>
    <script src="js/jquery.js"></script>
    <script src="node_modules/telegram-api-js/dist/telegramApi.js"></script>
<body>
</html>
  1. Set your app configuration
/* You should register your application on https://my.telegram.org/ */
telegramApi.setConfig({
  app: {
    id: 0, /* App ID */
    hash: 'qwertyasdfghzxcvbnqwertyasd', /* App hash */
    version: '0.0.0' /* App version */
  },
  server: {
    test: [
      {
        id: 2, /* DC ID */
        host: '0.0.0.0',
        port: 443
      }
    ],
    production: [
      {
        id: 2, /* DC ID */
        host: '0.0.0.0',
        port: 123
      }
    ]
  }
});
  1. Check your status
telegramApi.getUserInfo().then(function(user) {
    if (user.id) {
        // You have already signed in
    } else {
        // Log in
    }
});

API documentation

Keywords

FAQs

Last updated on 08 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc