Endpoint implementation in Lua for the Strava Webhook Event API (http://strava.github.io/api/v3/events/)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Strava Webhook Event API Endpoint

This repo provides an endpoint implementation in Lua for the Strava Webhook Event API. It uses the embedded Lua version for Nginx contained in OpenResty as building this extension yourself is quite a hassle (be warned!).

This is currently WIP, only the subscription part works for now.

Get the stuff up and running

  • Create an application for the Strava API.
  • Request access to the Webhook Event API from Strava. Drop a friendly mail to developers -at- strava.com, provide the client ID of your Strava application and why you want access to that part of the API.
  • Clone this project. Either run it as a Docker container using docker-compose up -d or deploy the Nginx configuration from files/nginx.conf in your own OpenResty server instance.
  • Execute the following command to register a callback with the Strava API. Substitute the variables with your values. The client ID and the client secret can be obtained from the Strava API website.

curl -X POST https://api.strava.com/api/v3/push_subscriptions \
  -F client_id=${CLIENT_ID} \
  -F client_secret=${CLIENT_SECRET} \
  -F 'object_type=activity' \
  -F 'aspect_type=create' \
  -F 'callback_url=https://${WEBSERVER}/strava' \
  -F 'verify_token=STRAVA'

Your access log should show a request from Strava containing a hub challenge: - - [28/Jun/2017:17:34:13 +0000] "GET /strava?hub.challenge=abcd1234&hub.mode=subscribe&hub.verify_token=STRAVA HTTP/1.1" 200 134 "-" "Go-http-client/1.1"

If everything works as expected you should get a reply like this:

  • Create a new activity on Strava and watch the access of your OpenResty instance for a callback from Strava. You should see something like - - [28/Jun/2017:17:41:41 +0000] "POST /strava HTTP/1.1" 200 121 "-" "Go-http-client/1.1"

in the logs.


  • handle updates (e.g. new activities) from Strava