Skip to content

Passing configuration object to FusionAuthClient 🤔 #36

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

Open
dakkafex opened this issue Aug 19, 2020 · 2 comments
Open

Passing configuration object to FusionAuthClient 🤔 #36

dakkafex opened this issue Aug 19, 2020 · 2 comments
Assignees
Labels

Comments

@dakkafex
Copy link

dakkafex commented Aug 19, 2020

Would be a syntactic improvement (if you ask me) if you could pass a configuration object to FusionAuthClient instead of directly passing the constructor values.

For readability it looks a tad nicer if you got

const client= new FusionAuthClient(
  { 
    apiKey: "asda-sd-asd",
    host: "https://localhost",
    tennantId: "bla-bla-bla"
  }
)
@dakkafex dakkafex changed the title Passing configuration object to FusionAuthClient Passing configuration object to FusionAuthClient 🤔 Aug 19, 2020
ianwensink added a commit to ianwensink/fusionauth-typescript-client that referenced this issue Sep 2, 2020
Both the constructor of FusionAuthClient and its exchangeOAuthCodeForAccessToken now also support calling them with an object instead of separate parameters. This helps when a lot of the parameters are optional (as per the docs). Completely backwards compatible.

FusionAuth#29 & FusionAuth#36
@robotdan robotdan self-assigned this Sep 8, 2020
@robotdan
Copy link
Member

robotdan commented Sep 8, 2020

Thanks for the suggestion @dakkafex . Feel free to submit a PR, or we may be able to get to this shortly, should be an easy addition.

@robotdan
Copy link
Member

robotdan commented Sep 8, 2020

Ah, I see there already is in open PR. #37 I'll take a look.

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

Successfully merging a pull request may close this issue.

2 participants