Can someone please point me to the code behind the new webhooks feature?
I wanted to understand specifically how the templates and variables work.
I see in the cli repo where the API call to the server is made to register the webhook.
However I’m not seeing in the server repo anywhere where the webhooks endpoint is defined.
Also I don’t find any results grepping the codebase for the variables that the doc says are used in the templates. That is: SPARK_EVENT_NAME, SPARK_EVENT_VALUE, SPARK_PUBLISHED_AT, SPARK_CORE_ID
Am I missing something? Or perhaps is the new code not up on GitHub?
My specific use case:
I have a single sensor successfully pushing data to firebase via a webhook.
For the next step, I’d like to parameterize the URL, so I wanted to check the implementation to see if that was feasible. I’ll experiment to try to figure it out, but I’d rather understand how it works.
@moonshot, if you are looking for the Local Cloud code for webhooks, there is none since this feature is not implemented there (yet?). The Spark Cloud is not open source. @Dave, can you provide guidance here?
Oh snaps, I didn’t realize that the local server code was different than the Spark Cloud. Thx for the info @peekay123. So is the Spark Cloud set up a private fork with the intent to merge new features upstream to the opensource repo, or is the intent for it to have private features?
I guess if I had to I could also do what I want by creating a redirector service, deploying somewhere like heroku, and pointing my webhook there. Does anybody know if the webhooks on Spark Cloud will follow 302 redirects?
My hope was that the full cloud would share modules with the open source cloud so that we could more easily share features and upgrades, but I haven’t had as much time as I’d like to invest in that just yet. We do open source a lot of features and functionality, but not always right away, and some things we might need to keep private for business reasons.
One of the awesome things about the local cloud is you can change it to do anything you’d like! My hope is this summer that we can add some clearer integration points, to make extending it easier.
+1 for local webhooks support in spark-server it’d be nice to be able to run it within a private (or totally disconnected) network with webhooks against a local https server from the spark-server (that way it’s encrypted end-to-end and the logic can continue to live in the boring old web app ).