LucidStandardImportDotNet 0.1.14

dotnet add package LucidStandardImportDotNet --version 0.1.14
                    
NuGet\Install-Package LucidStandardImportDotNet -Version 0.1.14
                    
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="LucidStandardImportDotNet" Version="0.1.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LucidStandardImportDotNet" Version="0.1.14" />
                    
Directory.Packages.props
<PackageReference Include="LucidStandardImportDotNet" />
                    
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 LucidStandardImportDotNet --version 0.1.14
                    
#r "nuget: LucidStandardImportDotNet, 0.1.14"
                    
#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 LucidStandardImportDotNet@0.1.14
                    
#: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=LucidStandardImportDotNet&version=0.1.14
                    
Install as a Cake Addin
#tool nuget:?package=LucidStandardImportDotNet&version=0.1.14
                    
Install as a Cake Tool

Simple C# Library implementation of the Lucid Standard Import.

Refer to https://developer.lucid.co/docs/overview-si

Example code:

using LucidStandardImport.Api;
using LucidStandardImport.Auth;
using LucidStandardImport.model;
using Microsoft.Extensions.Configuration;

var lucidDocument = new LucidDocument { Title = "Test Document" };
var page = new Page();
var layer = new Layer { Title = "Test Layer" };
var image = new ImageShape
{
    Image = new ImageFill(
        "test_image.png",
        ImageScale.Original
    ),
    BoundingBox = new BoundingBox(0, 0, 100, 100),
    Opacity = 60,
    Stroke = new Stroke { Width = 0 },
};
layer.AddShape(image);
page.AddShape(image);
page.AddLayer(layer);
lucidDocument.AddPage(page);

// Get config from appsettings.json, env variables user secrets, or other
var oAuthConfig = GetConfiguration();

var importer = new LucidStandardImporter()
{
    // use this to inspect the zip file that is to be uploaded to Lucid
    DebugOutputFileLocation = "<some-local-path>",
};
var oauthProvider = new LocalAuthProvider(oAuthConfig, "./authTokens");
var session = await oauthProvider.CreateLucidSessionAsync();
// almost always returns 1 result but may return more than 1 if the 
// file size of the import is larger than the 2MB limit
var urls = await importer.ImportDocument(session, lucidDocument, "test");

importer.LaunchUrlsInBrowser(urls);

Config can be defined inline, in user secrets, or env variables.

dotnet user-secrets init
dotnet user-secrets set "LucidOAuthConfig:ClientId" "your-client-id"
dotnet user-secrets set "LucidOAuthConfig:ClientSecret" "your-client-secret"
dotnet user-secrets set "LucidOAuthConfig:RedirectUri" "https://your-app/callback"

Example configuration:

/// <summary>
/// Gets the configuration from appsettings, env variables, and user secrets
/// </summary>
static LucidOAuthConfig GetConfiguration()
{
    var config = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory()) // Needed for JSON config
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) // Load from appsettings.json
        .AddEnvironmentVariables() // Load from environment variables
        .AddUserSecrets<Program>(optional: true) // Load from User Secrets in development
        .Build();

    var oAuthConfig = config.GetSection("LucidOAuthConfig").Get<LucidOAuthConfig>();
    if (oAuthConfig == null)
    {
        throw new ArgumentException(
            "OAuth configuration is missing or invalid. Define in appsettings.json, env variables, or user secrets."
        );
    }
    return oAuthConfig;
}

Using OAuth

To authenticate with the library you need a Lucid Session.

You'll need a developer project and, if you haven't published your project, to register your username with the developer application.

Refer to the Lucid Docs for that under OAuth. Once set up you can follow the patterns below:

Easiest way to get started is to use the LocalAuthProvider class - this will launch a server at the localhost:port specified in your redirectUrl in your oAuthConfig file (see above) and will handle the auth flow to create a code for an OAuth session.

You can also use the ConsolePromptingOauthProvider like so:


var oauthProvider = new LucidOAuthProvider(
    oAuthConfig,
    new LocalFileTokenStorage("./authTokens"),
    new ConsolePromptingOAuthFlow()
);

var session = await oauthProvider.CreateLucidSessionAsync();

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.1.14 21,280 3/16/2026
0.1.13 738 2/21/2026
0.1.12 471 1/27/2026
0.1.11 120 1/27/2026
0.1.10 9,090 7/17/2025
0.1.9 295 6/26/2025
0.1.8 205 6/26/2025
0.1.7 221 6/25/2025
0.1.6 198 6/25/2025
0.1.5 458 6/13/2025
0.1.4 348 6/13/2025
0.1.3 362 6/11/2025
0.1.2 233 6/6/2025
0.1.1 237 5/21/2025
0.1.0 276 2/11/2025