Facebook have created a few official javascript plugins to include on websites
Checkbox Plugin
The Checkbox Plugin allows you to authenticate people with Messenger and start a thread using your website. It’s similar to the “Send to Messenger” plugin, but optimized for forms where you want to provide a seamless way for people to receive updates via Messenger.
It could be used for just about any form-based flow on a site, including ecommerce websites where you wish to send receipts and order updates to the user, for event RSVPs, or even signup forms.
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.
Message Us Plugin
The “Message Us” plugin can be used to immediately start a conversation and send the person to Messenger. On the desktop web, the user is sent to messenger.com and on mobile they are sent to the Messenger native app.