Skip to content
/ fbwhs Public

Forwards Facebook webhooks to your local server

License

Notifications You must be signed in to change notification settings

bcen/fbwhs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Facebook Webhook as a Service

Usage

  • Starts the forward daemon locally

    $ ./forward http://localhost:4000/facebook/webhook_callback
    Forwarding SSE from "https://fbwhs.herokuapp.com/webhook/1HbA4TRlBeiS1nrfu5siRdgma7c" to "http://localhost:4000/facebook/webhook_callback"
    Usage:
    curl -X POST -d 'test=123' "https://fbwhs.herokuapp.com/webhook/1HbA4TRlBeiS1nrfu5siRdgma7c"
    
  • Registers the webhook callback from above with Facebook

    curl -F "object=user" \
        -F "callback_url=https://fbwhs.herokuapp.com/webhook/1HbA4TRlBeiS1nrfu5siRdgma7c" \
        -F "fields=about" \
        -F "verify_token=1HbA4TRlBeiS1nrfu5siRdgma7c" \
        -F "access_token={FB_APP_ACCESS_TOKEN}" \
        "https://graph.facebook.com/{FB_APP_ID}/subscriptions"
    

    Note: the last part of the webhook address is the verify_token. E.g. https://fbwhs.herokuapp.com/webhook/abc123 where abc123 is the verify_token.

  • Now, whenever Facebook sends a webhook to https://fbwhs.herokuapp.com/webhook/1HbA4TRlBeiS1nrfu5siRdgma7c, the daemon running locally will forward the request to your local server.

  • Also, you can test it with curl -X POST -d 'test=123' "https://fbwhs.herokuapp.com/webhook/1HbA4TRlBeiS1nrfu5siRdgma7c", the local server callback http://localhost:4000/facebook/webhook_callback should recieve a request with a body test=123.

How it works

tldr; The concept is same as smee, but we handle Facebook's verification request for you.

Deploying to Heroku

Deploy

About

Forwards Facebook webhooks to your local server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages