Solid.Superset.Client 1.0.2

dotnet add package Solid.Superset.Client --version 1.0.2
                    
NuGet\Install-Package Solid.Superset.Client -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Solid.Superset.Client" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Solid.Superset.Client" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Solid.Superset.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Solid.Superset.Client --version 1.0.2
                    
#r "nuget: Solid.Superset.Client, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Solid.Superset.Client@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Solid.Superset.Client&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Solid.Superset.Client&version=1.0.2
                    
Install as a Cake Tool

Solid.Superset.Client - the C# library for the Apache Superset API

A .NET 9 client library for Apache Superset, generated from Superset's OpenAPI specification. This client provides strongly-typed access to Superset's API endpoints with automatic session-based authentication and CSRF token management.

Command used to generate the API

This C# SDK is generated from Superset's OpenAPI specification using NSwag:

  • API version: 1.0
  • SDK version: 1.0.0
  • Build package: NSwag.MSBuild

For more information, please visit https://superset.apache.org/

<a id="frameworks-supported"></a>

Frameworks supported

  • .NET 9.0 or later

<a id="dependencies"></a>

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package Microsoft.Extensions.Http
Install-Package Microsoft.Extensions.Options

<a id="installation"></a>

Installation

Install the package from NuGet:

Install-Package Solid.Superset.Client

Or via .NET CLI:

dotnet add package Solid.Superset.Client

<a id="usage"></a>

Usage

Basic Setup

Register the Superset client in your Program.cs or Startup.cs:

using Solid.Superset.Client.Extensions;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSupersetClient(options =>
{
    options.BaseUrl = "http://localhost:8088";
    options.Username = "admin";
    options.Password = "admin";
});

Configuration

Configuration options are provided via SupersetAuthOptions:

  • BaseUrl (required) - Base URL of the Superset instance (e.g., "http://localhost:8088")
  • Username (required) - Username for service account authentication
  • Password (required) - Password for service account authentication

Using the Client

Once registered, inject the generated client interface:

using Solid.Superset.Client.Generated;

public class MyService
{
    private readonly ISupersetClient _supersetClient;

    public MyService(ISupersetClient supersetClient)
    {
        _supersetClient = supersetClient;
    }

    public async Task DoSomething()
    {
        // Use the client - authentication and CSRF tokens are handled automatically
        // var result = await _supersetClient.SomeEndpointAsync();
    }
}

<a id="getting-started"></a>

Getting Started

using Solid.Superset.Client.Extensions;
using Solid.Superset.Client.Generated;

var builder = WebApplication.CreateBuilder(args);

// Register the Superset client
builder.Services.AddSupersetClient(options =>
{
    options.BaseUrl = "https://superset.example.com";
    options.Username = "your_username";
    options.Password = "your_password";
});

var app = builder.Build();

// Use the client
var scope = app.Services.CreateScope();
var client = scope.ServiceProvider.GetRequiredService<ISupersetClient>();

try
{
    // Make API calls - authentication and CSRF tokens are handled automatically
    // var result = await client.SomeEndpointAsync();
}
catch (ApiException e)
{
    Console.WriteLine($"Exception: {e.Message}");
    Console.WriteLine($"Status Code: {e.StatusCode}");
}

Authentication

The client uses session-based authentication:

  1. Lazy authentication - Login occurs automatically on the first API request
  2. Session persistence - Session cookies are stored and reused across requests
  3. Automatic re-authentication - If a request returns 401, the client automatically re-authenticates and retries
  4. Thread-safe - Multiple concurrent requests are handled safely

CSRF Token Management

CSRF tokens are automatically managed:

  1. Lazy fetching - CSRF token is fetched before the first mutating request (POST/PUT/DELETE/PATCH)
  2. Automatic inclusion - Token is included in the X-CSRFToken header for mutating requests
  3. Token refresh - If a request returns 403, the token is refreshed and the request is retried

Features

  • Strongly-typed API client - Generated from Superset's OpenAPI specification using NSwag
  • Automatic authentication - Session-based authentication with cookie persistence
  • CSRF token management - Automatic CSRF token retrieval and inclusion on mutating requests
  • Dependency injection ready - Easy integration with .NET's dependency injection container
  • Thread-safe - Handles concurrent requests safely with proper locking

<a id="packaging"></a>

Packaging

This package is published to NuGet and can be consumed via standard NuGet package management tools.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 188 12/26/2025
1.0.1 187 12/26/2025