An easy-to-use JWT (RFC 7519) implementation for Dart. Sign, decode and verify — every standard algorithm, in just a few lines.
sign, decode, verify — one call each, no setup, no boilerplate. Pick an algorithm, pass your key, ship.
// 1. Build a JWT with your payload.final jwt = JWT({'id': 123,'server': {'id': '3e4fc296','loc': 'euw-2',},});// 2. Sign it (default HS256).final token = jwt.sign(SecretKey('secret passphrase'));print('Signed: $token');
RFC 7519 compliant. The only JWT library you need for anything written in Dart — from Flutter apps to backend services.
Full coverage of the JWA spec (RFC 7518) and the EdDSA extension (RFC 8037) — HMAC, RSA, RSA-PSS, ECDSA and EdDSA. Whatever your stack already trusts, dart_jsonwebtoken signs and verifies it out of the box.
| hash → ↓ family | SHA-256 standard | SHA-384 stronger | SHA-512 strongest | secp256k1 bitcoin curve |
|---|---|---|---|---|
| HMAC Fast shared-secret signatures | HS256 | HS384 | HS512 | — |
| RSA Classic asymmetric signatures | RS256 | RS384 | RS512 | — |
| RSA-PSS Modern RSA with random salt | PS256 | PS384 | PS512 | — |
| ECDSA Compact signatures, NIST curves | ES256 | ES384 | ES512 | ES256K |
| EdDSA State-of-the-art, deterministic | — | — | EdDSA | — |
The real dart_jsonwebtoken package running in your browser — compiled to JavaScript. Sign and verify with every algorithm the library supports.
The most-used JWT library for Dart.
Open source and actively maintained on GitHub — regular releases, prompt issue triage, contributions welcome.