Skip to content

A .NET standard 2.1 wrapper around the official Lago API.

License

Notifications You must be signed in to change notification settings

Zedo9/lago-dotnet

Repository files navigation

Lago .Net Client

A fluent .NET Standard 2.1 SDK wrapper built with Refit for Lago API.

Installation

Via Nuget:

# Package Manager
Install-Package Lago.NET.Client

# dotnet
dotnet add package Lago.NET.Client

Usage

Directly creating an instance of LagoClient

using Lago.NET.Client;

ILagoClient lagoClient = LagoClientFactory.Create("apiKey");
// Or with a custom host : LagoClientFactory.Create("apiKey", "https://api.getlago.com");

var addOnInput = new CreateAddOnInput("add_on_name", "add_on_code", 5000, "USD", "desc");
var result = await lagoClient.AddOns.CreateAsync(addOnInput);

Registering ILagoClient in your DI container using the provided extension method

// Startup.cs / Program.cs
using Lago.NET.Client.Extensions.DependencyInjection;

services.AddLagoClient((httpClient) => {
    /* Custom httpClient configuration */},
    "apiKey",
    "https://api.getlago.com" );
// CustomService.cs
using Lago.NET.Client;

public CustomService
{
  private readonly ILagoClient _lagoClient;

  public CustomService(ILagoClient lagoClient)
  {
    _lagoClient = lagoClient;
  }
}

License

Lago .NET client is distributed under the MIT license.

About

A .NET standard 2.1 wrapper around the official Lago API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages