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

Set license for API requests #1620

Open
marco-gallardo opened this issue Jun 16, 2023 · 1 comment
Open

Set license for API requests #1620

marco-gallardo opened this issue Jun 16, 2023 · 1 comment

Comments

@marco-gallardo
Copy link

Context:

Smarty offers different licenses that determine a set of available services, usage details, etc. Not being able to specify this license limits our integration with Smarty and prevents taking full advantage of Smarty's features.

Expected behavior

It'd be great to be available to provide license argument that ends up being passed to Smarty API:

Geocoder.configure(..., license: '<license>')

I reviewed geocoder's code and apparently this will require only a few files to be changed:

Any thoughts about this?

@alexreisner
Copy link
Owner

Yes, thanks, this sounds great, and it's actually even easier than you think. You can pass arbitrary parameters to specific lookups like this:

Geocoder.configure(..., smarty_streets: {license: '<license>'})

So there's no need to modify options or set_defaults. Just add the license parameter in query_url_params, where you can access it via configuration[:license] (configuration returns all config for the current lookup, merged into a single hash). You might also want to mention this in a "Notes" item in the Smarty documentation.

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

No branches or pull requests

2 participants