TeamVortexSoftware.VortexSDK 1.0.0

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

Vortex C# SDK

This package provides the Vortex C# SDK for authentication and invitation management.

With this SDK, you can generate JWTs for use with the Vortex Widget and make API calls to the Vortex API.

Installation

Install the SDK via NuGet:

dotnet add package TeamVortexSoftware.VortexSDK

Or via the Package Manager Console:

Install-Package TeamVortexSoftware.VortexSDK

Getting Started

Once you have the SDK installed, login to Vortex and create an API Key. Keep your API key safe! Vortex does not store the API key and it is not retrievable once it has been created.

Your API key is used to:

  • Sign JWTs for use with the Vortex Widget
  • Make API calls against the Vortex API

Usage

Generate a JWT for the Vortex Widget

The Vortex Widget requires a JWT to authenticate users. Here's how to generate one:

using TeamVortexSoftware.VortexSDK;

// Initialize the Vortex client with your API key
var vortex = new VortexClient(Environment.GetEnvironmentVariable("VORTEX_API_KEY"));

// User ID from your system
var userId = "users-id-in-my-system";

// Identifiers associated with the user
var identifiers = new List<Identifier>
{
    new Identifier("email", "user@example.com"),
    new Identifier("sms", "18008675309")
};

// Groups the user belongs to (specific to your product)
var groups = new List<Group>
{
    new Group("workspace", "workspace-123", "My Workspace"),
    new Group("document", "doc-456", "Project Plan")
};

// User role (if applicable)
var role = "admin";

// Generate the JWT
var jwt = vortex.GenerateJwt(userId, identifiers, groups, role);

Console.WriteLine(jwt);

Use with ASP.NET Core

Create an API endpoint to provide JWTs to your frontend:

using Microsoft.AspNetCore.Mvc;
using TeamVortexSoftware.VortexSDK;

[ApiController]
[Route("api/[controller]")]
public class VortexController : ControllerBase
{
    private readonly VortexClient _vortex;

    public VortexController(IConfiguration configuration)
    {
        _vortex = new VortexClient(configuration["Vortex:ApiKey"]);
    }

    [HttpGet("jwt")]
    public IActionResult GetJwt()
    {
        var userId = User.Identity?.Name ?? "anonymous";

        var identifiers = new List<Identifier>
        {
            new Identifier("email", User.Claims.FirstOrDefault(c => c.Type == "email")?.Value ?? "")
        };

        var groups = new List<Group>
        {
            new Group("workspace", "ws-1", "Main Workspace")
        };

        var jwt = _vortex.GenerateJwt(userId, identifiers, groups, "member");

        return Ok(new { jwt });
    }
}

Dependency Injection Setup

Register the VortexClient in your Program.cs:

builder.Services.AddSingleton<VortexClient>(sp =>
{
    var config = sp.GetRequiredService<IConfiguration>();
    return new VortexClient(config["Vortex:ApiKey"]);
});

Then inject it into your controllers or services:

public class MyService
{
    private readonly VortexClient _vortex;

    public MyService(VortexClient vortex)
    {
        _vortex = vortex;
    }

    public async Task<string> GenerateUserJwt(User user)
    {
        var jwt = _vortex.GenerateJwt(
            user.Id,
            new List<Identifier> { new("email", user.Email) },
            user.Groups.Select(g => new Group(g.Type, g.Id, g.Name)).ToList(),
            user.Role
        );

        return jwt;
    }
}

API Methods

All API methods are asynchronous and follow the async/await pattern.

Invitation Management

Get Invitations by Target
var invitations = await vortex.GetInvitationsByTargetAsync("email", "user@example.com");
Get Invitation by ID
var invitation = await vortex.GetInvitationAsync("invitation-id");
Revoke Invitation
await vortex.RevokeInvitationAsync("invitation-id");
Accept Invitations
var target = new InvitationTarget("email", "user@example.com");
var result = await vortex.AcceptInvitationsAsync(
    new List<string> { "invitation-id-1", "invitation-id-2" },
    target
);
Get Invitations by Group
var invitations = await vortex.GetInvitationsByGroupAsync("workspace", "workspace-123");
Delete Invitations by Group
await vortex.DeleteInvitationsByGroupAsync("workspace", "workspace-123");
Reinvite
var result = await vortex.ReinviteAsync("invitation-id");

Requirements

  • .NET 6.0 or higher
  • System.Text.Json (included as dependency)

Best Practices

Dispose Pattern

The VortexClient implements IDisposable. Use it with a using statement when appropriate:

using (var vortex = new VortexClient(apiKey))
{
    var jwt = vortex.GenerateJwt(userId, identifiers, groups, role);
    // Use jwt...
}

Or when using dependency injection, the framework will handle disposal automatically.

Error Handling

All API methods can throw VortexException. Wrap calls in try-catch blocks:

try
{
    var invitations = await vortex.GetInvitationsByTargetAsync("email", "user@example.com");
}
catch (VortexException ex)
{
    Console.WriteLine($"Vortex API error: {ex.Message}");
}

License

MIT

Support

For support, please contact support@vortexsoftware.com or visit our documentation.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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
1.10.0 74 2/25/2026
1.9.4 73 2/25/2026
1.9.3 83 2/20/2026
1.9.2 86 2/20/2026
1.9.1 86 2/16/2026
1.9.0 93 2/12/2026
1.7.0 90 2/5/2026
1.6.0 89 2/4/2026
1.4.0 90 2/3/2026
1.3.0 93 1/28/2026
1.1.3 100 1/5/2026
1.1.1 283 12/17/2025
1.1.0 285 12/16/2025
1.0.1 150 10/31/2025
1.0.0 191 10/21/2025