Conversation
|
Hey there! Thanks for your contribution and sorry for the lack of response! We'll try to have a look at this during the week 😊 |
|
Sorry for the late reply! Great work on the implementation 🔥 . We think it could be a great feature addition, but we'd like to discuss the implementation itself! While we did drill-down Another way we could simplify this would be to simply set this up during the configuration, in the config :algoliax,
credentials: %{
default: {"APPLICATION_ID", "api_key"},
custom_1: {System.get_env("APP_ID_1"), System.get_env("APP_KEY_1")} # Reachable then using `Application.get_env`
custom_2: {System.get_env("APP_ID_2"), System.get_env("APP_KEY_2")}
}Then, in your This would avoid drilling down Would that still work with your usecase? |
|
@Jordan-Kowal What you suggested was close to how I had implemented this in my application. I skipped the |
I needed a way to specify the application_id / api_key per index (for a multi-tenant application).
In our case each tenant can have different fields that we index on, so we created one index (module) per tenant. That allowed the application_id / api_key to be a zero-arity function.
There's a little duplication on the requests
application_idand the url_paramsapplication_id. I liked how the routes interpolated all the url_params though so I didn't want to have a special case.