Giter Club home page Giter Club logo

intergram's Introduction

Intergram

Free live chat widget linked to your Telegram messenger.

Embed Intergram in your website with these 2 simple steps

  1. Open Telegram messenger, search for @Intergram and hit /start to get your unique chat ID.

  1. Paste this snippet right before the closing body tag of every page where you want the chat to appear (Don't forget to add your actual chat ID).
<script> window.intergramId = <Your unique chat ID> </script>
<script id="intergram" type="text/javascript" src="https://www.intergram.xyz/js/widget.js"></script>

Note: replying to a specific message should be used to respond to that specific visitor. Sending a standard message will broadcast to all connected chat clients (You might find it easier to use if you have only one active conversation)

I have tried to keep the footprint as small as possible.

  • Preact
  • The widget injection script is about 5KB gziped and executes only after the host page finished loading ('onload' event).
  • The chat iframe will only be loaded if the user interacts with the chat widget (currently about 40KB gziped).

Since the hosting cost are quite minimal (server, domain, cdn), I plan to keep this service 100% free (no ads also!). The only thing I might use it for, is testing new technologies from other projects I work on.

Deploy your own Intergram instance (The hard way)

  1. Talk to Telegram @BotFather, create a new bot and get its API Token.

  2. Deploy this repo to your own chat server.

  • Clone it locally and install or if you use Heroku, fork this repository and point the new app to it.
  • Set an .env varible named TELEGRAM_TOKEN with the value you got from @BotFather
  1. Point the bot webhook to your bot server by making a GET request to the following url https://api.telegram.org/bot<TOKEN>/setWebhook?url=<Server url>/hook (Don't forget to replace with your token and server url)

  2. Open a chat with your bot and hit /start to get your unique chat ID

  3. Embed this sinpet in your website

<script> 
  window.intergramId = <Your unique chat ID>
  window.intergramIFrameSrc = <Server url> + '/chat.html'
</script>
<script id="intergram" type="text/javascript" src="<Server url>/js/widget.js"></script>
  1. ๐ŸŽ‰

intergram's People

Contributors

idoco avatar

Watchers

Greenbox.id avatar James Cloos avatar

Forkers

aanksaputra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.