Update README, clarify license, reorganize project structure, and add WhatsApp Cloud API stub#25
Conversation
|
Hi @jcrites! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Note: Please don't merge yet on my behalf. Like a diff, I may make a few final tweaks.
Changes the license to vanilla MIT
The previously license conflated terms of service with the license and will (from my past corporate OSS experience) make the project more difficult for companies to use – if it's not precisely using one of the well-known approved licenses, then the developer's Legal team might need to look at it, adding friction.
Since FB developers need to accept the ToS to create an account and use platforms anyway, this did not seem to add value, and rather subtracted value.
Updated the
README.mdto reflect the changes in the diffCorrected minor mistakes (e.g., it was referring to the
masterbranch when the primary branch ismain). Added a reference to some Webhook examples that exist in other repositories.Reorganized folder structure
Since the repository has multiple languages, Facebook platforms, and support for deploying to cloud platforms, I thought it would make sense to organize the directory structure so that people who are looking for a particular example can easily find it.
Thus I moved the existing folders into:
Added WhatsApp Cloud API Example
I added a stub of the Cloud API Webhook handler under
whatsapp-platform/nodejs/graph-api-webhook-server/. This code was already public in our documentation without a license, and I just copied it here to begin working with it.It's been difficult for me to receive incoming Webhooks so I haven't been able to test it yet. I tried to set up an instance on AWS but ran into difficulties – the burden of requiring an HTTPS URL means I need a domain name, TLS certificate, and server listening on port 443. I was working on setting this up when I had to stop. (I tried using API Gateway to provide an HTTPS URL in front of a NodeJS server running on EC2, but couldn't get the full system working for inexplicable reasons.)
I'd also like to change the behavior of the existing program from being an echo-bot to being one that provides a callback structure internal for each event type, which in the example is implemented by simply printing the event to the console. This way the developer could easily copy the example and start replacing the event callbacks with their own code.
The current example is an echo-bot, and while that would be a useful example too, my original goal was to build a skeleton that makes it easier to handle event types by detecting their type, deserializing them (less meaningful in JavaScript; more so in other languages), and invoking an event-specific method – for as many languages I could manage.