Send-to-Messenger Plugin
The "Send to Messenger" plugin is used to trigger an authentication event to your webhook. You can pass in data to know which user and transaction was tied to the authentication event, and link the user on your back-end.

The first time a person clicks on this button, a confirmation popup will be presented.

When your app is in development mode, the plugin is only visible to admins, developers and testers of the app. In development mode, the plugin will not be visible if there isn't an active session.
Setup
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: "APP_ID",
xfbml: true,
version: "v2.6"
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
... Plugin Code
<div class="fb-send-to-messenger" messenger_app_id="APP_ID" page_id="PAGE_ID" data-ref="PASS_THROUGH_PARAM" color="blue" size="standard"> </div>
Settings
| Parameter | Description | Type | Required |
|---|---|---|---|
| Color of the button | Enum ( | N, default is |
| Size of the plugin | Enum ( | N, default is |
| Custom state parameter. It should be encoded and encrypted for security purposes. | String of max 250 characters.
Valid characters are | N |
| If | boolean | N, default is |
Use the data-ref param to pass state with the authentication. If you surface the plugin in multiple places, you may want to modify the state based on the place where the plugin is shown.
Event Subscription
Subscribe to plugin events.
<script>
FB.Event.subscribe('send_to_messenger', function(e) {
// callback for events triggered by the plugin
});
</script>
Event Fields
| Field Name | Type | Description |
|---|---|---|
| Enum | Name of event. Possible values: |
| String | Contains the value set on the |
| Boolean | Indicates whether event happened after the confirmation pop-up was confirmed. |
| undefined | This field is not used. |
Callback
This triggers the opt-in callback.

