Stytch.net 2.4.0

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

Stytch dotnet Library

The Stytch .NET library makes it easy to use the Stytch user infrastructure API in .NET applications.

Install

Using .NET CLI:

dotnet add package Stytch.net

Usage

You can find your API credentials in the Stytch Dashboard.

This client library supports all of Stytch's live products:

B2C

B2B

Example B2C usage

Create an API client:

using Stytch.net.Clients;

var client = new Stytch.net.Clients.ConsumerClient(new ClientConfig
{
    ProjectId = "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
    ProjectSecret = "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I="
});

Send a magic link by email:

client.OTPs.Email.LoginOrCreate(new OTPsEmailLoginOrCreateRequest(email: "sandbox@stytch.com"){
    LoginMagicLinkUrl = "https://example.com/authenticate",
    SignupMagicLinkUrl = "https://example.com/authenticate"
});

Authenticate the token from the magic link:

client.MagicLinks.Authenticate(new AuthenticateRequest(token: "DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94="));

Example B2B usage

Create an API client:

using Stytch.net.Clients;

var client = new Stytch.net.Clients.B2BClient(new ClientConfig
{
    ProjectId = "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
    ProjectSecret = "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I="
});

Create an organization

client.Organizations.Create(new B2BOrganizationsCreateRequest(organizationName: "Acme Co"){
    OrganizationSlug = "acme-co",
    EmailAllowedDomains = ["acme.co"],
    EmailJITProvisioning = "RESTRICTED"
});

Log the first user into the organization

client.MagicLinks.Email.LoginOrSignup(new B2BMagicLinksEmailLoginOrSignupRequest(){
    OrganizationId = "organization-id-from-create-response-...",
    EmailAddress = "admin@acme.co",
}));

Support

If you've found a bug, open an issue!

If you have questions or want help troubleshooting, join us in Slack or email support@stytch.com.

If you've found a security vulnerability, please follow our responsible disclosure instructions.

Development

See DEVELOPMENT.md

Code of Conduct

Everyone interacting in the Stytch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.10.0 200 9/11/2025
2.9.0 111 9/11/2025
2.8.0 126 9/10/2025
2.7.0 248 8/29/2025
2.6.0 175 8/28/2025
2.5.0 198 8/27/2025
2.4.0 175 8/27/2025
2.3.0 186 8/25/2025
2.2.1 120 8/25/2025
2.2.0 215 8/14/2025
2.1.0 162 8/12/2025
2.0.1 303 8/6/2025
2.0.0 216 8/6/2025
1.3.0 22,614 10/29/2024
1.2.2 121 10/25/2024
1.2.1 162 10/24/2024
1.2.0 108 10/24/2024
1.1.0 131 10/14/2024
1.0.0 155 10/4/2024