Skip to content
This repository was archived by the owner on Jun 25, 2023. It is now read-only.

Creating the client

Keith edited this page Jul 6, 2021 · 1 revision

Creating a BattleMetrics developer token

Setting up the BattlemetricsNet client

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"]

Reusability

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
Clone this wiki locally