.NET
The reference SDK: async end to end, a TimeSpan timeout on every wait, exceptions that carry the problem body.
Waridex.Client- Requires
- .NET 8, 9 or 10
- Package
- Waridex.Client on NuGet, when it ships
SDKs
The .NET SDK is the reference implementation. TypeScript mirrors it method for method, and everything they do is plain HTTPS if you'd rather call the REST API yourself.
The reference SDK: async end to end, a TimeSpan timeout on every wait, exceptions that carry the problem body.
Waridex.ClientA typed client for Node, ESM and CommonJS, with no runtime dependencies. Works in Playwright, Cypress, Jest and Vitest.
@waridex/clientJSON over HTTPS with bearer keys. Waiting is one long-poll call, so any HTTP client works.
curl -H "Authorization: Bearer $KEY" …Same test, two languages
Create an inbox, wait for the one-time code, use it. Both SDKs expose the same operations and the same response schemas, in the casing your language expects.
using Waridex.Client; var client = new WaridexClient(Environment.GetEnvironmentVariable("WARIDEX_API_KEY")!); var run = $"run-{Guid.NewGuid():N}"; // one tag per run, purged at the end var inbox = await client.Inboxes.CreateAsync("signup", tags: [run]); var address = inbox.AddressFor("user1"); await app.SignUpAsync(address); var otp = await inbox.WaitForOtpAsync( to: address, timeout: TimeSpan.FromSeconds(30)); await app.VerifyAsync(otp); await client.Inboxes.DeleteByTagAsync(run);
import { Waridex } from '@waridex/client'; const waridex = new Waridex({ apiKey: process.env.WARIDEX_API_KEY! }); const run = `run-${crypto.randomUUID()}`; // one tag per run, purged at the end const inbox = await waridex.inboxes.create({ name: 'signup', tags: [run] }); const address = inbox.addressFor('user1'); await app.signUp(address); const otp = await inbox.waitForOtp({ to: address, timeoutMs: 30_000 }); await app.verify(otp); await waridex.inboxes.deleteByTag(run);
using Waridex.Client; var client = new WaridexClient(Environment.GetEnvironmentVariable("WARIDEX_API_KEY")!); var run = $"run-{Guid.NewGuid():N}"; // one tag per run, purged at the end var inbox = await client.Inboxes.CreateAsync("signup", tags: [run]); var address = inbox.AddressFor("user1"); await app.SignUpAsync(address); var otp = await inbox.WaitForOtpAsync( to: address, timeout: TimeSpan.FromSeconds(30)); await app.VerifyAsync(otp); await client.Inboxes.DeleteByTagAsync(run);
import { Waridex } from '@waridex/client'; const waridex = new Waridex({ apiKey: process.env.WARIDEX_API_KEY! }); const run = `run-${crypto.randomUUID()}`; // one tag per run, purged at the end const inbox = await waridex.inboxes.create({ name: 'signup', tags: [run] }); const address = inbox.addressFor('user1'); await app.signUp(address); const otp = await inbox.waitForOtp({ to: address, timeoutMs: 30_000 }); await app.verify(otp); await waridex.inboxes.deleteByTag(run);
Test framework fixtures
The Playwright fixtures hand each test its own inbox under the worker's tag and purge the tag when the worker ends, so a failed run never leaves a mess behind and parallel tests never share an address.
@waridex/client/playwrightinbox, a fresh tagged inbox per test, and tag, one per worker, purged when the worker ends.services.AddWaridex(...)Registers the .NET client with dependency injection, for xUnit and NUnit suites.import { test } from '@waridex/client/playwright'; test('a one-time code signs the user in', async ({ page, inbox }) => { const address = inbox.addressFor('user1'); await page.goto('/signup'); await page.fill('#email', address); await page.click('text=Send me a code'); const otp = await inbox.waitForOtp({ to: address, timeoutMs: 30_000 }); await page.fill('#otp', otp); // the worker's tag purges its inboxes when the worker ends });
WaitForOtpAsync, WaitForLinkAsync and WaitForMessageAsync, and their TypeScript twins, loop the wait call for you, so a 30-second timeout is one line.
.NET takes a TimeSpan and throws WaridexTimeoutException or WaridexExtractionException with the problem body; TypeScript takes timeoutMs.
Both cores are generated from the public OpenAPI document, so MessageResponse, CodeResponse and LinkResponse carry the same fields in each, in your language's casing.
Both default to api.waridex.com and take a base URL for a staging stack or the local Compose stack.
The REST API is small and documented. Tell us what you'd use and we'll prioritise the next client.