This repository was archived by the owner on Jun 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Creating the client
Keith edited this page Jul 6, 2021
·
1 revision
- Create a developer account with battle metrics (https://www.battlemetrics.com/developers)
- Create an api token on the developers page using the "New Token" button. Save the token somewhere
Setting up the client is straight forward.
new BmClient("devToken")- I recommend putting your token in an App.config or somewhere else outside of the application, and referencing it through ConfigurationManager, or any other token/secret based setup
- I personally use ConfigurationManager. ex:
ConfigurationManager.AppSettings["BmToken"]
- I personally use ConfigurationManager. ex:
To reuse the client over the code with minimal resources being wasted:
- Setup a ServiceCollection
- Add your bmClient as a singleton
- Constructor inject in other classes