PHPackages                             andre/bionic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. andre/bionic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andre/bionic
============

Bionic is a simple chat bot development library in PHP

v2.1.9(2y ago)91043[2 PRs](https://github.com/mpaannddreew/bionic-php/pulls)MITPHP

Since Nov 13Pushed 2y ago3 watchersCompare

[ Source](https://github.com/mpaannddreew/bionic-php)[ Packagist](https://packagist.org/packages/andre/bionic)[ RSS](/packages/andre-bionic/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (26)Used By (0)

Bionic
------

[](#bionic)

Bionic is a simple chat bot development library in PHP.

It is driven by a very simple but powerful event dispatching library [Événement](https://github.com/igorw/evenement) and [Guzzle](https://github.com/guzzle/guzzle) a PHP HTTP client that makes it easy to send HTTP requests

Platform support
----------------

[](#platform-support)

- Facebook Messenger
- WhatsApp
- Instagram
- Telegram
- Viber

Facebook Messenger and Instagram
--------------------------------

[](#facebook-messenger-and-instagram)

What is covered
---------------

[](#what-is-covered)

- Create a FB Page
- Create a FB app
- Create a webhook
- Connect the Facebook app to the Facebook page
- Setup Bionic

Installation
------------

[](#installation)

### Create a FB page

[](#create-a-fb-page)

First login to Facebook and [create a Facebook page](https://www.facebook.com/pages/create). Choose the settings that fits best your bot, but for testing it is not important.

### Create a FB Messenger app

[](#create-a-fb-messenger-app)

Go to the [developer's app page](https://developers.facebook.com/apps/). Click "Add a New App" and fill the basic app fields.

On the "Product Setup" page choose Messenger and click "Get Started".

Now you need to create a token to give your app access to your Facebook page. Select the created page, grant permissions and copy the generated token. You need that one later.

### Create a webhook for the Facebook app for either Messenger or Instagram

[](#create-a-webhook-for-the-facebook-app-for-either-messenger-or-instagram)

Your application needs to have a webhook. This means a public URL that Facebook can communicate with. Every time a user sends a message inside the FB chat, FB will send it to this URL which is the entry point to your application.

### Connect the Facebook app to your application

[](#connect-the-facebook-app-to-your-application)

Now that you got the URL you need to setup the webhook. Go back to you Facebook app settings and click `Setup Webhooks`inside the Webhooks part.

Fill in the public URL, check the subscription fields you want to with and click `Verify and Save`.

***Note:*** You need to write your own webhook verification logic in your application.

### Setup Bionic

[](#setup-bionic)

The recommended way to install Bionic is [through composer](http://getcomposer.org).

Just create a composer.json file for your project and require it:

```
composer require andre/bionic

```

Now you can add the autoloader, and you will have access to the library:

```
