Creating the client - MangoDevx/BattleMetricsNet GitHub Wiki

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