MichaelSL / botanclient

NET Client for Yandex Botan bot analytics service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yandex Metrica Botan client

⚠️ The Botan service has been shut down. This repository is archived now. ⚠️

Yandex Metrica Botan client for .NET NETStandard 2.0

Build status

Usage

Reference BotanClient

Install via NuGet:

PM> Install-Package BotanClient

or build the NuGet with Cake build:

./build.ps1 -target "BotanClient"

Modify your project code

Register client in your services and provide your yandex metrica token:

services.AddSingleton(_ => new BotanClient.BotanClient(botanToken));

Inject client into your controller:

private readonly BotanClient.BotanClient botanClient;

public UpdateController(BotanClient.BotanClient botanClient)
{
    this.botanClient = botanClient;
}

Send data to Botan:

await botanClient.SendEvent(new BotanMessage
{
    EventName = "MY_EVENT",
    RawData = new {
        message = message,
        someMetric = 1.0
    },
    Uid = "UserIdHere"
});

About

NET Client for Yandex Botan bot analytics service

License:MIT License


Languages

Language:C# 41.1%Language:HTML 27.4%Language:PowerShell 25.8%Language:JavaScript 3.4%Language:CSS 2.3%