leancode_kratos_client 0.1.0 copy "leancode_kratos_client: ^0.1.0" to clipboard
leancode_kratos_client: ^0.1.0 copied to clipboard

unlisted

A Flutter library for connecting to Ory Kratos. It helps manage user authentication, registration, making it simple to add identity features to your app.

KratosClient #

The KratosClient provides an API client for interacting with an Ory Kratos server.

Usage #

To create a client #

final client = KratosClient(
  baseUri: Uri.parse('https://kratos.example.com'), 
  browserCallback: (url) async {
    // open browser and return code
  },
);

Features #

The main available APIs are #

Registration #

  • registerWithPassword - Register using email and password
  • registerWithOidc - Register using OpenID Connect provider
  • registerWithPasskey - Register using a passkey

Login #

  • loginWithPassword - Login with email and password
  • loginWithPasskey - Login with a passkey

Verification #

  • getVerificationFlow - Get verification flow
  • verifyAccount - Complete email verification

Recovery #

  • getRecoveryFlow - Get account recovery flow
  • sendEmailRecoveryFlow - Initiate email account recovery
  • sendCodeRecoveryFlow - Submit recovery code

Profile #

  • getUserProfile - Get user profile
  • updateTraits - Update user profile traits
  • updatePassword - Update user password

Settings #

  • addPasskey - Add a new passkey
  • removePasskey - Remove a linked passkey
  • getPasskeys - Get all linked passkeys

Other #

  • logout - Logout user
  • refreshSessionToken - Refresh session token

Credentials Storage #

The client handles persisting credentials like the session token. By default it uses FlutterSecureCredentialsStorage but you can pass a custom CredentialsStorage on construction.

Error Handling #

Most methods return a union type for success or failure responses. See code for details on specific error types.

HTTP Client #

The http.Client used to make requests can be customized by passing your own on construction.

Logging #

Debug logging is printed using the logging package.

1
likes
0
points
97
downloads

Publisher

verified publisherleancode.co

Weekly Downloads

A Flutter library for connecting to Ory Kratos. It helps manage user authentication, registration, making it simple to add identity features to your app.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, flutter, flutter_secure_storage, freezed, freezed_annotation, http, json_annotation, logging

More

Packages that depend on leancode_kratos_client