grant icon indicating copy to clipboard operation
grant copied to clipboard

Dynamic custom_params

Open maricavor opened this issue 11 months ago • 1 comments
trafficstars

The dynamic configuration allows certain configuration keys to be set dynamically over HTTP GET/POST request. What about custom_params, how to set then dynamically custom_params: {ui_locales: 'en'}?

maricavor avatar Dec 17 '24 08:12 maricavor

The same way as with any other parameter:

var qs = require('qs')
qs.stringify({scope: ['asdf'], custom_params: {ui_locales: 'en'}})
// or a similar method in the browser
// note that some querystring libraries cannot encode nested objects properly

and then your provider configuration needs something like this:

{
  "your-provider": {
    "dynamic": ["scope", "custom_params"]
  }
}

Let me know if that helps.

simov avatar Dec 17 '24 09:12 simov