Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README, clarify license, reorganize project structure, and add WhatsApp Cloud API stub #25

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jcrites
Copy link

@jcrites jcrites commented Jun 7, 2022

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.md to reflect the changes in the diff

Corrected minor mistakes (e.g., it was referring to the master branch when the primary branch is main). 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.

  1. Developers are likely to be using a particular FB Platform, so that's the top level folder.
  2. After that, they will likely be using or prefer to use a particular programming language, so that's next in the hierarchy.
  3. Finally, if the example demonstrates deploying to a Cloud Platform (e.g. Heroku), that's a final folder in the hierarchy.

Thus I moved the existing folders into:

facebook-pages/coffeescript/hubot/
instagram-subscriptions/heroku/nodejs/

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.

@facebook-github-bot
Copy link

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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants