ignacio-chiazzo / ruby_whatsapp_sdk

A lightweight, efficient Ruby gem for interacting with Whatsapp Cloud API.
https://ignacio-chiazzo.github.io/ruby_whatsapp_sdk/
MIT License
161 stars 36 forks source link

Add the ability to set the API version during configuration #117

Closed ignacio-chiazzo closed 8 months ago

ignacio-chiazzo commented 9 months ago

Currently, the Whatsapp API version is hardcoded here. We should expose a way for apps to set up the API version during initialization.

For example, we could provide a config method api_version which sets the version for all API requests.

Hints

The configuration lives in configuration.rb. We could accept an api_version argument which is used across the API.

If the argument isn't passed, we'd use the hardcoded version.

paulomcnally commented 9 months ago

What do you think about creating the ruby_whatsapp_sdk_rails gem where https://rubygems.org/gems/railties can be used to create an initializer to set this value?

My suggestion is for projects where Ruby on Rails is used.

paulomcnally commented 9 months ago

This is an basic example -> https://github.com/paulomcnally/ruby_whatsapp_sdk_rails (This repository is an example, I do not plan to release the gem)

ignacio-chiazzo commented 9 months ago

I would like to update the library so that it is framework agnostic (not rails required). I think the setup is easy enough that devs can include it on their repo.

What's the goal of the gem?

paulomcnally commented 9 months ago

I have seen that it is common practice to create a gem for use in rails where it gives you the benefit of generators, initializer logic through rails, etc.

It would definitely be enough to implement it in the library as you do for access_token.

conr commented 9 months ago

Hey there @ignacio-chiazzo 👋🏻

Can you assign this issue to me?

I would love to work on it. Cheers!

ignacio-chiazzo commented 9 months ago

Sure! Thanks

conr commented 9 months ago

I think you accidentally assigned it to yourself 😄

ignacio-chiazzo commented 9 months ago

Oh haha sorry, fixed!

conr commented 8 months ago

Shall we close this issue now? 🙂