jwt_decode_token 1.0.0

Dart native js
Flutter Android iOS web

A starting point for Dart libraries or applications.

A library for decoding a JWT token to extract the payload.

Usage #

A simple usage example:

import 'package:jwt_decode_token/jwt_decode_token.dart';

main() {
    String token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiMSIsInVzZXJuYW1lIjoiZGFydHNvY2lldHkiLCJlbWFpbCI6ImhlbGxvQGRhcnRzb2NpZXR5LmRldiJ9LCJpYXQiOjE1ODc3NzIyMTUsImV4cCI6MTU5MDM2NDIxNX0.ixXHGIxVXsbhkV5fUO11RG84cxebOlVVjrBa7rkcUXY';
    
    Map<String, dynamic> payload = decodeJwt(token);
  
    print(payload);
    // --> {user: {id: 1, username: dartsociety, email: hello@dartsociety.dev}, iat: 1587772215, exp: 1590364215}
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

4
likes
90
pub points
63%
popularity

Publisher

dartsociety.dev

A starting point for Dart libraries or applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on jwt_decode_token