Dokie 0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Dokie --version 0.0.3
                    
NuGet\Install-Package Dokie -Version 0.0.3
                    
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="Dokie" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dokie" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Dokie" />
                    
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 Dokie --version 0.0.3
                    
#r "nuget: Dokie, 0.0.3"
                    
#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 Dokie@0.0.3
                    
#: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=Dokie&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Dokie&version=0.0.3
                    
Install as a Cake Tool

<img src="https://github.com/mergehez/dokie/blob/main/ui/src/assets/logo.svg?raw=true" alt="dokie logo" width="120" height="120">

Dokie

NuGet NuGet License

An API client and documentation UI, inspired by Postman. A replacement for libraries like Swagger UI and Scalar.

Installation

  1. Using Package Manager:
    Install-Package Dokie
    
  2. Using .NET CLI:
    dotnet add package Dokie
    
  3. Using NuGet Package Manager: search for Dokie

Usage

To use Dokie in your ASP.NET Core application, you'll have to use OpenAPI to document your API endpoints. Dokie will automatically generate the UI based on the OpenAPI specification.

After installing the package, you can set it up in your Program.cs file as follows:

using Microsoft.OpenApi;
using Dokie;

var builder = WebApplication.CreateBuilder(args);

var services = builder.Services;

services.AddOpenApi("v1", options =>
{
    options.OpenApiVersion = OpenApiSpecVersion.OpenApi3_0;
    options.AddDokie();
});

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseDokie("v1", new DokieOptions
    {
        Title = "Dokie",
        HostnameOptions = ["https://prod-site.com"],
        PredefinedVariables = new Dictionary<string, string>
        {
            { "username", _secrets.Username },
            { "password", _secrets.Password },
        },
        PredefinedHeaders = new Dictionary<string, string>
        {
            { "x-api-key", "" },
            { "Content-Type", "application/json" },
        },
        Postscripts = new Dictionary<string, string>
        {
            { "GET /api/login", "envs.headers['x-api-key'] = response.data.value.ticket;" },
        },
        PredefinedFavoriteEndpoints =
        [
            "GET /api/login"
        ]
    });
}

app.Run();

After setting up the above code, you can access the Dokie UI at /dokie in your browser.

Features

  • OpenAPI Support: Automatically generates the UI based on OpenAPI specifications.
  • Configurable: Set predefined variables, headers, and postscripts.
  • Hostname Switching: Easily switch between different hostnames for testing.
  • Favorites: Mark endpoints as favorites for quick access.
  • Environment Variables: Add/remove environment variables to manage sensitive data like API keys.
  • Global headers: Set global headers for all requests.
  • Postscripts: Add custom scripts that run after a request is made, allowing you to set environment variables or global headers based on the response. (JavaScript)
  • Endpoint Configuration: Easily add path/query parameters, headers and body to requests. You can use environment variables just like in Postman.

Note that changes are stored in your local machine and not shared with other people using the same project. Following information is stored in the browser's indexedDB:

  • Environment variables
  • Global headers
  • Favorite endpoints
  • Current hostname
  • Endpoint specific: Path/Query parameters, Headers and Postscript

Screenshots

Screenshot 1 Screenshot 2

Contributing

Feel free to contribute to the project by creating issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details. Feel free to use, modify, and distribute this code as per the terms of the license.

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
0.0.7 151 7/15/2025
0.0.6 151 7/2/2025
0.0.5 302 6/10/2025
0.0.4 279 6/10/2025
0.0.3 272 6/9/2025
0.0.2 272 6/9/2025
0.0.1 204 6/9/2025