ignacio-chiazzo/ruby_whatsapp_sdk

Add the ability to set the API version during configuration

Closed this issue ยท 9 comments

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.

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.

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)

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?

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

Hey there @ignacio-chiazzo ๐Ÿ‘‹๐Ÿป

Can you assign this issue to me?

I would love to work on it. Cheers!

Sure! Thanks

conr commented

I think you accidentally assigned it to yourself ๐Ÿ˜„

Oh haha sorry, fixed!

conr commented

Shall we close this issue now? ๐Ÿ™‚