Skip to the documentation
Knowledge base

Typed SDKs

TypeScript, Python, Ruby, PHP, Go, Java and C# clients, one method for every operation.

Details

  • Published on npm and in use. @nextmail/sdk is a complete, dependency-free TypeScript client, published as both ESM and CommonJS, with one method for every documented operation the API serves, plus the two unauthenticated meta endpoints a client generator needs, and the key read from NEXTMAIL_API_KEY, a 30-second per-attempt timeout, two retries, a per-call apiKey override for a process serving several workspaces, and emails.iterate() to page a list without writing the cursor loop. It runs on Node 20 and up, Workers, Deno, Bun and the browser. A key with the wrong prefix throws at construction rather than 401-ing on the first call; the check is a prefix and nothing more, so a well-formed key that has been revoked still fails on the wire.
  • It is held to the server by a parity check that reads the OpenAPI document on every build and fails if the two drift: a method pointing at an operation the spec does not have, a documented operation with no method, a scope list that does not match the one the operation requires, a namespace with methods and no entry in the reference, or a method that does not send the request its own manifest names. It prints what it proved, and today that reads 684 SDK methods covering all 548 documented operations. Two generator scripts stand beside it and refuse to emit an operation that is unclassified or written with an em dash. That is why the client is not a wrapper written after the fact. It cannot lag the API by a release.
  • Python, Ruby, PHP, Go, Java and C# have clients of their own: the nextmail package on PyPI, with a sync and an async client for Python 3.10 and up, the nextmail gem for Ruby 3.2 and up, nextmail/sdk on Packagist for PHP 8.2 and up, the nextmail-go module for Go 1.24 and up, sh.nextmail:nextmail on Maven Central for Java 17 and up, and Nextmail on NuGet for .NET 8 and up. Each carries a parity check that runs every TypeScript method against its twin and compares the exact HTTP request, so a method the TypeScript client gains fails the other six until they have it too. Every other language is served by the OpenAPI document, which generates a client in each.