### Install the package Source: https://pub.dev/packages/flutter_better_auth Add the dependency to your project using the terminal. ```bash flutter pub add flutter_better_auth ``` -------------------------------- ### GET /passkey/generate-register-options Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/generateRegistrationOptions.html Retrieves the necessary options to begin the passkey registration process. ```APIDOC ## GET /passkey/generate-register-options ### Description Retrieves registration options required to register a new passkey for the user. ### Method GET ### Endpoint /passkey/generate-register-options ### Parameters #### Query Parameters - **name** (String) - Optional - The name associated with the registration. - **authenticatorAttachment** (String) - Optional - Specifies the type of authenticator attachment. - **context** (String) - Optional - Additional context for the registration request. ### Response #### Success Response (200) - **Map** - A map containing the registration options. ``` -------------------------------- ### GET /passkey/generate-authenticate-options Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/generateAuthenticationOptions.html Retrieves the authentication options required to initiate a passkey authentication flow. ```APIDOC ## GET /passkey/generate-authenticate-options ### Description Retrieves the authentication options required to initiate a passkey authentication flow. ### Method GET ### Endpoint /passkey/generate-authenticate-options ``` -------------------------------- ### GET /api-key/get Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/fetch.html Retrieves an API key using the specified ID and optional configuration ID. ```APIDOC ## GET /api-key/get ### Description Retrieves an API key from the server. This method is equivalent to the Better Auth client `authClient.apiKey.get` operation. ### Method GET ### Endpoint /api-key/get ### Parameters #### Query Parameters - **configId** (String) - Optional - The configuration ID associated with the API key. - **id** (String) - Required - The unique identifier for the API key. ``` -------------------------------- ### list method implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/list.html Defines the GET request structure for listing API keys with query parameters. ```dart @GET('/api-key/list') Future> list({ @Query('configId') String? configId, @Query('organizationId') String? organizationId, @Query('limit') int? limit, @Query('offset') int? offset, @Query('sortBy') String? sortBy, @Query('sortDirection') String? sortDirection, }); ``` -------------------------------- ### initialize Source: https://pub.dev/documentation/flutter_better_auth/latest/core_flutter_better_auth/FlutterBetterAuth-class.html Initializes the authentication system with the required base URL and optional configuration parameters. ```APIDOC ## initialize ### Description Initializes the FlutterBetterAuth instance with the necessary configuration. ### Signature `static Future initialize({required String url, Dio? dio, StorageInterface? store, String? scheme, bool refreshSessionOnAppResume = true, bool refreshSessionOnReconnect = true})` ### Parameters - **url** (String) - Required - The base URL for the authentication service. - **dio** (Dio) - Optional - Custom Dio instance. - **store** (StorageInterface) - Optional - Custom storage implementation. - **scheme** (String) - Optional - App scheme. - **refreshSessionOnAppResume** (bool) - Optional - Whether to refresh the session when the app resumes. - **refreshSessionOnReconnect** (bool) - Optional - Whether to refresh the session on network reconnect. ``` -------------------------------- ### GET /organization/list-teams Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listTeams.html Retrieves a list of teams associated with an organization. ```APIDOC ## GET /organization/list-teams ### Description Retrieves a list of teams for a given organization. ### Method GET ### Endpoint /organization/list-teams ### Parameters #### Query Parameters - **organizationId** (String) - Optional - The ID of the organization to filter teams by. ### Response - **Result>** - A result object containing a list of OrganizationTeam objects. ``` -------------------------------- ### GET /organization/get-invitation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/fetchInvitation.html Retrieves an organization invitation by its unique identifier. ```APIDOC ## GET /organization/get-invitation ### Description Fetches the details of an organization invitation using the provided invitation ID. ### Method GET ### Endpoint /organization/get-invitation ### Parameters #### Query Parameters - **id** (String) - Required - The unique identifier of the invitation to fetch. ### Response #### Success Response (200) - **Result** - Returns a result object containing the organization invitation details. ``` -------------------------------- ### SignUpBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_sign_up_better_auth/SignUpBetterAuth/SignUpBetterAuth.html Initializes a new instance of the SignUpBetterAuth service. ```APIDOC ## SignUpBetterAuth Constructor ### Description Initializes a new instance of the SignUpBetterAuth service using a provided Dio instance. ### Signature `SignUpBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger})` ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A logger instance for handling parsing errors. ``` -------------------------------- ### GET /passkey/list-user-passkeys Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/listUserPasskeys.html Retrieves a list of passkey records for the authenticated user. ```APIDOC ## GET /passkey/list-user-passkeys ### Description Retrieves a list of all passkeys registered to the current user. ### Method GET ### Endpoint /passkey/list-user-passkeys ### Response #### Success Response (200) - **List** - A list of passkey objects associated with the user. ``` -------------------------------- ### initialize Source: https://pub.dev/documentation/flutter_better_auth/latest/core_flutter_better_auth/FlutterBetterAuth/initialize.html Initializes the BetterAuth client with the required configuration parameters. ```APIDOC ## initialize(url, dio, store, scheme, refreshSessionOnAppResume, refreshSessionOnReconnect) ### Description Initializes the FlutterBetterAuth library. This must be called before using other authentication methods to configure the base URL, network client, and storage persistence. ### Parameters - **url** (String) - Required - The base URL of the authentication server. - **dio** (Dio?) - Optional - A custom Dio instance for network requests. - **store** (StorageInterface?) - Optional - A custom storage implementation for persisting authentication data. - **scheme** (String?) - Optional - Native deep-link scheme (e.g., 'myapp') required for native social authentication. - **refreshSessionOnAppResume** (bool) - Optional - Whether to refresh the auth stream when the app returns to the foreground. Defaults to true. - **refreshSessionOnReconnect** (bool) - Optional - Whether to refresh the auth stream when the device regains network connectivity. Defaults to true. ``` -------------------------------- ### GET /api-key/list Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/list.html Retrieves a list of API keys with optional configuration, organization, pagination, and sorting filters. ```APIDOC ## GET /api-key/list ### Description Retrieves a list of API keys based on the provided query parameters. ### Method GET ### Endpoint /api-key/list ### Parameters #### Query Parameters - **configId** (String) - Optional - Filter by configuration ID - **organizationId** (String) - Optional - Filter by organization ID - **limit** (int) - Optional - Number of items to return - **offset** (int) - Optional - Number of items to skip - **sortBy** (String) - Optional - Field to sort by - **sortDirection** (String) - Optional - Direction of sorting ``` -------------------------------- ### Initialize the client Source: https://pub.dev/packages/flutter_better_auth Configure the Better Auth client in your main function and wrap your app with the provider. ```dart import 'package:flutter/material.dart'; import 'package:flutter_better_auth/flutter_better_auth.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await FlutterBetterAuth.initialize( url: 'https://your-server.com/api/auth', // Better Auth base URL scheme: 'myapp', // deep-link scheme (required for native social) ); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return BetterAuthProvider( child: MaterialApp(home: const HomePage()), ); } } ``` -------------------------------- ### listUserInvitations Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listUserInvitations.html Retrieves a list of organization invitations via a GET request. ```APIDOC ## GET /organization/list-user-invitations ### Description Retrieves a list of organization invitations. Optionally filter the results by providing an email address. ### Method GET ### Endpoint /organization/list-user-invitations ### Parameters #### Query Parameters - **email** (String) - Optional - The email address to filter the invitations by. ``` -------------------------------- ### BetterAuthClient get client Source: https://pub.dev/documentation/flutter_better_auth/latest/core_flutter_better_auth/FlutterBetterAuth/client.html Retrieves the singleton instance of the BetterAuthClient. The library must be initialized via initialize() before accessing this property. ```APIDOC ## BetterAuthClient get client ### Description Returns the initialized `BetterAuthClient` instance. This property is used to access authentication methods provided by the package. ### Usage ```dart final client = FlutterBetterAuth.client; ``` ### Requirements - The library must be initialized by calling `initialize()` before accessing this property, otherwise an assertion error will be thrown. ``` -------------------------------- ### GET /token Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_jwt_jwt_better_auth/JwtBetterAuth/token.html Retrieves a JWT token by calling the token endpoint. ```APIDOC ## GET /token ### Description Retrieves a JWT token from the authentication service. ### Method GET ### Endpoint /token ``` -------------------------------- ### AdminBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_admin_admin_better_auth/AdminBetterAuth/AdminBetterAuth.html Initializes a new instance of the AdminBetterAuth client. ```APIDOC ## AdminBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new instance of the AdminBetterAuth client using the provided Dio instance and optional configuration. ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String?) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger?) - Optional - A logger instance for handling parsing errors. ``` -------------------------------- ### create Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth-class.html Creates a new API key with the specified configuration and metadata. ```APIDOC ## create ### Description Creates a new API key. ### Signature `Future> create({String? configId, String? name, int? expiresIn, String? userId, String? organizationId, String? prefix, int? remaining, Map? metadata, Map? permissions})` ``` -------------------------------- ### POST /two-factor/get-totp-uri Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_two_factor_two_factor_better_auth/TwoFactorBetterAuth/getTotpUri.html Retrieves the TOTP URI for two-factor authentication setup. ```APIDOC ## POST /two-factor/get-totp-uri ### Description Retrieves a TOTP URI for configuring two-factor authentication. This operation requires the user's password. ### Method POST ### Endpoint /two-factor/get-totp-uri ### Parameters #### Request Body - **password** (String) - Optional - The user's password required for verification. ### Response - **Result** - Returns a result containing the TOTP URI response object. ``` -------------------------------- ### Future init(bool persistSession, bool ignoreExpires) Source: https://pub.dev/documentation/flutter_better_auth/latest/core_storage_memory_storage/MemoryStorage/init.html Initializes the storage instance, allowing configuration of session persistence and expiration handling. ```APIDOC ## init ### Description Initializes the `Storage` instance, for example by preparing storage paths. ### Signature `Future init(bool persistSession, bool ignoreExpires)` ### Parameters - **persistSession** (bool) - Determines if the session should be persisted. - **ignoreExpires** (bool) - Determines if expiration checks should be ignored. ``` -------------------------------- ### POST /api-key/create Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/create.html Creates a new API key with the specified configuration, user, and permission details. ```APIDOC ## POST /api-key/create ### Description Creates a new API key using the provided configuration parameters. ### Method POST ### Endpoint /api-key/create ### Request Body - **configId** (String) - Optional - The configuration ID. - **name** (String) - Optional - The name of the API key. - **expiresIn** (int) - Optional - Expiration time in seconds. - **userId** (String) - Optional - The ID of the user associated with the key. - **organizationId** (String) - Optional - The ID of the organization associated with the key. - **prefix** (String) - Optional - The prefix for the API key. - **remaining** (int) - Optional - The remaining usage count. - **metadata** (Map) - Optional - Additional metadata for the key. - **permissions** (Map) - Optional - Permissions associated with the key. ### Response - **Result** - Returns a result containing the created ApiKeyModel. ``` -------------------------------- ### listOrganizations() Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listOrganizations.html Retrieves a list of organizations by performing a GET request to the /organization/list endpoint. ```APIDOC ## GET /organization/list ### Description Retrieves a list of organizations available to the user. ### Method GET ### Endpoint /organization/list ### Response - **Result>** - A result object containing a list of organization payloads. ``` -------------------------------- ### GET /organization/get-active-member-role Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/getActiveMemberRole.html Retrieves the active member role for a specified user and organization. ```APIDOC ## GET /organization/get-active-member-role ### Description Retrieves the active member role for a user within an organization. You must provide the userId and either an organizationId or an organizationSlug. ### Method GET ### Endpoint /organization/get-active-member-role ### Parameters #### Query Parameters - **userId** (String) - Optional - The ID of the user. - **organizationId** (String) - Optional - The ID of the organization. - **organizationSlug** (String) - Optional - The slug of the organization. ``` -------------------------------- ### SignUpBetterAuth Factory Constructor Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_sign_up_better_auth/SignUpBetterAuth/SignUpBetterAuth.html Initializes the authentication service using the provided Dio instance and optional configuration parameters. ```dart factory SignUpBetterAuth( Dio dio, { String? baseUrl, ParseErrorLogger? errorLogger, }) = _SignUpBetterAuth; ``` -------------------------------- ### SignInBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_in_sign_in_better_auth/SignInBetterAuth/SignInBetterAuth.html Initializes a new instance of the SignInBetterAuth client. ```APIDOC ## SignInBetterAuth Constructor ### Description Initializes a new instance of the SignInBetterAuth client using a provided Dio instance. ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String?) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger?) - Optional - A logger instance for handling parsing errors. ``` -------------------------------- ### Implement jwks method Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_jwt_jwt_better_auth/JwtBetterAuth/jwks.html Implementation of the jwks method using the @GET annotation. ```dart @GET('/jwks') Future> jwks(); ``` -------------------------------- ### EmailOtpBetterAuth.new Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_email_otp_email_otp_better_auth/EmailOtpBetterAuth/EmailOtpBetterAuth.html Initializes a new instance of the EmailOtpBetterAuth service using the provided Dio client and optional configuration. ```APIDOC ## EmailOtpBetterAuth.new ### Description Creates a new instance of the EmailOtpBetterAuth service. This factory constructor requires a Dio instance for network requests and accepts optional parameters for base URL configuration and error logging. ### Signature EmailOtpBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Parameters - **dio** (Dio) - Required - The Dio instance used for API communication. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### GET /organization/list-team-members Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listTeamMembers.html Retrieves a list of team members associated with a specific team ID. ```APIDOC ## GET /organization/list-team-members ### Description Retrieves a list of team members for a given team ID. ### Method GET ### Endpoint /organization/list-team-members ### Parameters #### Query Parameters - **teamId** (String) - Optional - The ID of the team to retrieve members for. ``` -------------------------------- ### BetterAuthClient(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_better_auth_client/BetterAuthClient/BetterAuthClient.html Initializes a new instance of the BetterAuthClient using the provided Dio instance and optional configuration. ```APIDOC ## BetterAuthClient Constructor ### Description Initializes a new instance of the BetterAuthClient. This factory constructor requires a Dio instance for network requests and accepts optional parameters for base URL configuration and error logging. ### Signature BetterAuthClient(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Parameters - **dio** (Dio) - Required - The Dio instance used for performing network requests. - **baseUrl** (String?) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger?) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### listInvitations Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listInvitations.html Retrieves a list of organization invitations via a GET request to the /organization/list-invitations endpoint. ```APIDOC ## GET /organization/list-invitations ### Description Retrieves a list of organization invitations. Optionally filter the results by providing an organizationId. ### Method GET ### Endpoint /organization/list-invitations ### Parameters #### Query Parameters - **organizationId** (String) - Optional - The ID of the organization to filter invitations by. ``` -------------------------------- ### ApiKeyBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/ApiKeyBetterAuth.html Initializes a new instance of the ApiKeyBetterAuth class using the provided Dio client and optional configuration. ```APIDOC ## ApiKeyBetterAuth constructor ### Description Creates a new instance of the ApiKeyBetterAuth client. This is the primary entry point for initializing the authentication service. ### Signature `ApiKeyBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger})` ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### GET /one-time-token/generate Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_one_time_token_one_time_token_better_auth/OneTimeTokenBetterAuth/generate.html Generates a one-time token. Requires an authenticated session via cookies. ```APIDOC ## GET /one-time-token/generate ### Description Generates a one-time token for the authenticated user. ### Method GET ### Endpoint /one-time-token/generate ### Authentication Requires an authenticated session (cookies). ``` -------------------------------- ### AnonymousBetterAuth.new Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_anonymous_anonymous_better_auth/AnonymousBetterAuth/AnonymousBetterAuth.html Initializes a new instance of the AnonymousBetterAuth client. ```APIDOC ## AnonymousBetterAuth.new ### Description Creates a new instance of the AnonymousBetterAuth client using the provided Dio instance and optional configuration. ### Constructor Signature `AnonymousBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger})` ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### MagicLinkBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_magic_link_magic_link_better_auth/MagicLinkBetterAuth/MagicLinkBetterAuth.html Initializes a new instance of the MagicLinkBetterAuth client. ```APIDOC ## MagicLinkBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new instance of the MagicLinkBetterAuth client using the provided Dio instance and optional configuration. ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### listDeviceSessions API endpoint definition Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_multi_session_multi_session_better_auth/MultiSessionBetterAuth/listDeviceSessions.html Defines the GET endpoint for retrieving device sessions. ```dart @GET.new('/multi-session/list-device-sessions') Future>> listDeviceSessions() ``` ```dart @GET('/multi-session/list-device-sessions') Future>> listDeviceSessions(); ``` -------------------------------- ### GET /admin/list-users Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_admin_admin_better_auth/AdminBetterAuth/listUsers.html Retrieves a list of users with optional pagination, search, and sorting parameters. ```APIDOC ## GET /admin/list-users ### Description Retrieves a list of admin users. Supports pagination, searching, and sorting the results. ### Method GET ### Endpoint /admin/list-users ### Parameters #### Query Parameters - **limit** (int) - Optional - The maximum number of users to return. - **offset** (int) - Optional - The number of users to skip. - **searchValue** (String) - Optional - A string to filter users by. - **sortBy** (String) - Optional - The field to sort the results by. - **sortDirection** (String) - Optional - The direction of the sort (e.g., asc or desc). ``` -------------------------------- ### PasskeyBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/PasskeyBetterAuth.html Initializes a new instance of the PasskeyBetterAuth class with a Dio client and an optional base URL. ```APIDOC ## PasskeyBetterAuth constructor ### Signature PasskeyBetterAuth(Dio _dio, {String? baseUrl}) ### Parameters - **_dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. ``` -------------------------------- ### GET /admin/get-user Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_admin_admin_better_auth/AdminBetterAuth/getUser.html Retrieves details for a specific admin user based on the provided ID. ```APIDOC ## GET /admin/get-user ### Description Retrieves an admin user's information by their unique identifier. ### Method GET ### Endpoint /admin/get-user ### Parameters #### Query Parameters - **id** (String) - Required - The unique identifier of the admin user to retrieve. ``` -------------------------------- ### SocialBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_social_social_better_auth/SocialBetterAuth/SocialBetterAuth.html Initializes a new instance of the SocialBetterAuth client. ```APIDOC ## SocialBetterAuth constructor ### Description Initializes a new instance of the SocialBetterAuth client using a provided Dio instance. ### Signature SocialBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger) - Optional - A logger instance for handling parsing errors. ``` -------------------------------- ### verifyEmail implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_better_auth_client/BetterAuthClient/verifyEmail.html The implementation of the verifyEmail method using the @GET annotation and query parameters. ```dart @GET('/verify-email') Future> verifyEmail({ @Query("token") required String token, @Query("callbackURL") String? callbackURL, }); ``` -------------------------------- ### Configure Better Auth Server Source: https://pub.dev/packages/flutter_better_auth Initialize the Better Auth instance with trusted origins and required plugins for native social sign-in. ```typescript import { betterAuth } from "better-auth"; import { expo } from "@better-auth/expo"; export const auth = betterAuth({ trustedOrigins: ["myapp://"], // your app scheme plugins: [ expo(), // required for native social sign-in // twoFactor(), organization(), admin(), passkey(), jwt(), // phoneNumber(), emailOTP(), apiKey(), anonymous(), oneTimeToken(), ... ], emailAndPassword: { enabled: true }, socialProviders: { /* google, github, … */ }, }); ``` -------------------------------- ### Initialize EmailOtpBetterAuth Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_email_otp_email_otp_better_auth/EmailOtpBetterAuth/EmailOtpBetterAuth.html Use this factory constructor to instantiate the EmailOtpBetterAuth service with a required Dio client and optional base URL and error logger. ```dart factory EmailOtpBetterAuth( Dio dio, { String? baseUrl, ParseErrorLogger? errorLogger, }) = _EmailOtpBetterAuth; ``` -------------------------------- ### GET /organization/list-members Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listMembers.html Retrieves a list of members for an organization, supporting pagination, sorting, and filtering parameters. ```APIDOC ## GET /organization/list-members ### Description Retrieves a paginated list of organization members. Supports filtering by field, operator, and value, as well as sorting by specific fields and directions. ### Method GET ### Endpoint /organization/list-members ### Parameters #### Query Parameters - **limit** (int) - Optional - The maximum number of members to return. - **offset** (int) - Optional - The number of records to skip. - **sortBy** (String) - Optional - The field to sort the results by. - **sortDirection** (String) - Optional - The direction of the sort (e.g., asc, desc). - **filterField** (String) - Optional - The field to apply the filter on. - **filterOperator** (String) - Optional - The operator to use for filtering. - **filterValue** (String) - Optional - The value to filter by. - **organizationId** (String) - Optional - The unique identifier of the organization. - **organizationSlug** (String) - Optional - The slug identifier of the organization. ### Response #### Success Response (200) - **Result** - Returns a result object containing a page of organization members. ``` -------------------------------- ### listOrganizations Retrofit implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listOrganizations.html Defines the GET request to the /organization/list endpoint using Retrofit annotations. ```dart @GET('/organization/list') Future>> listOrganizations(); ``` -------------------------------- ### POST /sign-up/email Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_sign_up_better_auth/SignUpBetterAuth/email.html Registers a new user using their name, email, and password. ```APIDOC ## POST /sign-up/email ### Description Registers a new user account using email authentication. ### Method POST ### Endpoint /sign-up/email ### Request Body - **name** (String) - Required - The user's display name. - **email** (String) - Required - The user's email address. - **password** (String) - Required - The user's password. - **callbackURL** (String) - Optional - A URL to redirect to after sign-up. ``` -------------------------------- ### Initialize PasskeyBetterAuth Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/PasskeyBetterAuth.html Constructor for initializing the authentication service with a Dio client and optional base URL. ```dart PasskeyBetterAuth(this._dio, {String? baseUrl}) : _baseUrl = baseUrl; ``` -------------------------------- ### GET /organization/get-full-organization Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/getFullOrganization.html Retrieves the full organization payload based on the provided identifier and optional parameters. ```APIDOC ## GET /organization/get-full-organization ### Description Retrieves full organization details. Users can specify the organization via ID or slug and optionally limit the number of members returned. ### Method GET ### Endpoint /organization/get-full-organization ### Parameters #### Query Parameters - **organizationId** (String) - Optional - The unique identifier of the organization. - **organizationSlug** (String) - Optional - The URL-friendly slug of the organization. - **membersLimit** (int) - Optional - The maximum number of members to return. ### Response - **Result** - Returns a Result object containing the OrganizationPayload if found. ``` -------------------------------- ### Implement Passkey Authentication Source: https://pub.dev/packages/flutter_better_auth Use these methods to handle WebAuthn registration, authentication, and passkey management. Requires the @better-auth/passkey server plugin. ```dart import 'package:flutter_better_auth/plugins/passkey/passkey_plugin.dart'; // 1. Get options from the server final opts = await client.passkey.generateRegistrationOptions(/* … */); // 2. Run the device ceremony with your WebAuthn package → credential JSON // 3. Send it back await client.passkey.verifyRegistration(/* body: { response, name } */); // Sign-in await client.passkey.generateAuthenticationOptions(); await client.passkey.verifyAuthentication(/* body: { response } */); // Manage await client.passkey.listUserPasskeys(); await client.passkey.updatePasskey(id: '', name: 'My phone'); await client.passkey.deletePasskey(id: ''); ``` -------------------------------- ### getActiveMember Retrofit definition Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/getActiveMember.html Defines the GET request endpoint for fetching the active organization member. ```dart @GET('/organization/get-active-member') Future> getActiveMember(); ``` -------------------------------- ### GET /multi-session/list-device-sessions Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_multi_session_multi_session_better_auth/MultiSessionBetterAuth/listDeviceSessions.html Retrieves a list of all sessions stored on the device, including user information for each session. ```APIDOC ## GET /multi-session/list-device-sessions ### Description Retrieves all sessions stored on the current device, returning a list of session objects containing user details. ### Method GET ### Endpoint /multi-session/list-device-sessions ### Response #### Success Response (200) - **List** (array) - A list of session objects stored on the device. ``` -------------------------------- ### Configure Custom Storage Source: https://pub.dev/packages/flutter_better_auth Initialize the client with a custom storage implementation, such as the built-in Hive store. Ensure the storage is initialized before passing it to the client. ```dart // Built-in unencrypted Hive store (opt-in, native only — uses dart:io): import 'package:flutter_better_auth/flutter_better_auth.dart'; import 'package:flutter_better_auth/core/storage/hive_storage.dart'; await HiveStorage.init(); // opens the Hive box first await FlutterBetterAuth.initialize( url: '…', store: HiveStorage(), // or your own StorageInterface implementation ); ``` -------------------------------- ### Future forceInit() Source: https://pub.dev/documentation/flutter_better_auth/latest/core_storage_custom_persist_cookie_jar/CustomPersistCookieJar/forceInit.html Forces the initialization of the cookie jar by calling the internal _checkInitialized method with the force flag enabled. ```APIDOC ## forceInit() ### Description Forces the initialization of the cookie jar. This method invokes the internal initialization check with the force parameter set to true. ### Signature `Future forceInit()` ### Returns - **Future** - A future that completes when the initialization check has finished. ``` -------------------------------- ### Define jwks abstract method Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_jwt_jwt_better_auth/JwtBetterAuth/jwks.html Initial definition of the jwks method using the @GET annotation. ```dart @GET.new('/jwks') Future> jwks() ``` -------------------------------- ### HiveStorage.init() Source: https://pub.dev/documentation/flutter_better_auth/latest/core_storage_hive_storage/HiveStorage-class.html Initializes the Hive storage system. This must be called before performing storage operations. ```APIDOC ### Static Method `static Future init()` ### Description Initializes the Hive storage engine. This method should be invoked during application startup to ensure the storage layer is ready for use. ``` -------------------------------- ### getUser abstract method implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_admin_admin_better_auth/AdminBetterAuth/getUser.html Defines the GET request structure for retrieving a user by ID. ```dart @GET('/admin/get-user') Future> getUser({ @Query('id') required String id, }); ``` -------------------------------- ### POST /organization/create Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/create.html Creates a new organization with the provided details. ```APIDOC ## POST /organization/create ### Description Creates a new organization record. ### Method POST ### Endpoint /organization/create ### Parameters #### Request Body - **name** (String) - Required - The name of the organization. - **slug** (String) - Required - The unique slug for the organization. - **userId** (String) - Optional - The ID of the user associated with the organization. - **logo** (String) - Optional - The URL or path to the organization logo. - **metadata** (Map) - Optional - Additional metadata for the organization. - **keepCurrentActiveOrganization** (bool) - Optional - Flag to maintain the current active organization status. ### Response - **Result** - Returns a result containing the organization payload. ``` -------------------------------- ### Implementation of ApiKeyModel properties Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_models_api_key_model/ApiKeyModel/start.html Defines the getter methods for the ApiKeyModel, including the nullable start property. ```dart String get id; String get configId; String? get name; String? get start; ``` -------------------------------- ### OrganizationBetterAuth Constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_better_auth/OrganizationBetterAuth-class.html Initializes the OrganizationBetterAuth client with a Dio instance and an optional base URL. ```APIDOC ## OrganizationBetterAuth(Dio _dio, {String? baseUrl}) ### Description Creates an instance of the OrganizationBetterAuth client to interact with organization endpoints. ### Parameters - **_dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String?) - Optional - The base URL for the API requests. ``` -------------------------------- ### ApiKey model property definitions Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_models_api_key/ApiKey/start.html Defines the id, name, and start properties for the ApiKey model. ```dart String get id; String? get name; String? get start; ``` -------------------------------- ### listTeams Retrofit implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listTeams.html Defines the GET request to the /organization/list-teams endpoint with an optional organizationId query parameter. ```dart @GET('/organization/list-teams') Future>> listTeams({ @Query('organizationId') String? organizationId, }); ``` -------------------------------- ### PhoneBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_phone_phone_better_auth/PhoneBetterAuth/PhoneBetterAuth.html Initializes a new instance of the PhoneBetterAuth service with the required Dio client and optional configuration. ```APIDOC ## PhoneBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new instance of the PhoneBetterAuth service. This factory constructor requires a Dio instance for network requests and allows for optional base URL and error logging configuration. ### Parameters - **dio** (Dio) - Required - The Dio instance used for performing network requests. - **baseUrl** (String?) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger?) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### listInvitations Retrofit Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listInvitations.html Defines the GET request to the /organization/list-invitations endpoint with an optional organizationId query parameter. ```dart @GET('/organization/list-invitations') Future>> listInvitations({ @Query('organizationId') String? organizationId, }); ``` -------------------------------- ### Implementation of the create method Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_better_auth/OrganizationBetterAuth/create.html This snippet shows the implementation of the create method which delegates the request to the internal API. ```dart Future> create({ required String name, required String slug, String? userId, String? logo, Map? metadata, bool? keepCurrentActiveOrganization, }) => _api.create( name: name, slug: slug, userId: userId, logo: logo, metadata: metadata, keepCurrentActiveOrganization: keepCurrentActiveOrganization, ); ``` -------------------------------- ### GET /jwks Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_jwt_jwt_better_auth/JwtBetterAuth/jwks.html Retrieves the JSON Web Key Set (JWKS) used for verifying JWT tokens. ```APIDOC ## GET /jwks ### Description Retrieves the JSON Web Key Set (JWKS) required for JWT token verification. ### Method GET ### Endpoint /jwks ### Response #### Success Response (200) - **JwtKeyResponse** (object) - The JSON Web Key Set response. ``` -------------------------------- ### Implementation of forceInit Source: https://pub.dev/documentation/flutter_better_auth/latest/core_storage_custom_persist_cookie_jar/CustomPersistCookieJar/forceInit.html This method triggers an initialization check with the force flag enabled. ```dart Future forceInit() => _checkInitialized(force: true); ``` -------------------------------- ### BetterAuthClient Constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_better_auth_client/BetterAuthClient-class.html Initializes a new instance of the BetterAuthClient. ```APIDOC ## BetterAuthClient(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new BetterAuthClient instance using a Dio client. ### Parameters - **dio** (Dio) - Required - The Dio instance for network requests. - **baseUrl** (String) - Optional - The base URL for the API. - **errorLogger** (ParseErrorLogger) - Optional - A logger for handling parsing errors. ``` -------------------------------- ### Define token abstract method Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_jwt_jwt_better_auth/JwtBetterAuth/token.html Defines the token method using the @GET annotation to retrieve a JwtTokenResponse. ```dart @GET('/token') Future> token(); ``` -------------------------------- ### Initialize HiveStorage Source: https://pub.dev/documentation/flutter_better_auth/latest/core_storage_hive_storage/HiveStorage/init.html Initializes Hive with the application documents directory and opens the 'better_auth_cookies' box. This should be called before performing any storage operations. ```dart static Future init() async { final dir = await getApplicationDocumentsDirectory(); Hive.init(dir.path); await Hive.openBox('better_auth_cookies'); } ``` -------------------------------- ### POST /api-key/verify Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/verify.html Verifies an API key by sending the key, optional configuration ID, and permissions to the server. ```APIDOC ## POST /api-key/verify ### Description Verifies an API key. This method checks the validity of the provided key and returns a result containing the verification response. ### Method POST ### Endpoint /api-key/verify ### Parameters #### Request Body - **configId** (String) - Optional - The configuration ID associated with the API key. - **key** (String) - Required - The API key to be verified. - **permissions** (Map) - Optional - A map of permissions to validate against the key. ``` -------------------------------- ### Initialize ApiKeyBetterAuth Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_api_key_better_auth/ApiKeyBetterAuth/ApiKeyBetterAuth.html Use this factory constructor to create an instance of ApiKeyBetterAuth by providing a Dio client and optional configuration. ```dart factory ApiKeyBetterAuth( Dio dio, { String? baseUrl, ParseErrorLogger? errorLogger, }) = _ApiKeyBetterAuth; ``` -------------------------------- ### listSessions abstract method definition Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_better_auth_client/BetterAuthClient/listSessions.html Defines the abstract method for fetching sessions via a GET request. ```dart @GET('/list-sessions') Future>> listSessions(); ``` -------------------------------- ### create(name, slug, userId, logo, metadata, keepCurrentActiveOrganization) Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_better_auth/OrganizationBetterAuth/create.html Creates a new organization with the specified parameters. ```APIDOC ## create(name, slug, userId, logo, metadata, keepCurrentActiveOrganization) ### Description Creates a new organization record. Returns a Result containing an OrganizationPayload. ### Parameters - **name** (String) - Required - The name of the organization. - **slug** (String) - Required - The unique URL-friendly identifier for the organization. - **userId** (String) - Optional - The ID of the user associated with the organization. - **logo** (String) - Optional - A URL or path to the organization logo. - **metadata** (Map) - Optional - Additional custom metadata for the organization. - **keepCurrentActiveOrganization** (bool) - Optional - Flag to determine if the current active organization should be maintained. ### Returns - **Result** - A result object containing the created organization payload. ``` -------------------------------- ### Implementation of listUserPasskeys Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_passkey_passkey_better_auth/PasskeyBetterAuth/listUserPasskeys.html This method performs a GET request to the /passkey/list-user-passkeys endpoint and maps the response to a list of PasskeyRecord objects. ```dart Future>> listUserPasskeys() async { try { final response = await _dio.get( '$_root/passkey/list-user-passkeys', options: _jsonOptions(_dio), ); final data = response.data; if (data is! List) { return Result.err( BetterError(message: 'Expected passkey array', stack: ''), ); } final list = data .map((e) => PasskeyRecord.fromJson(_asMap(e))) .toList(growable: false); return Result.ok(list); } on DioException catch (e, s) { return _passkeyErr(e, s, e); } catch (e, s) { return Result.err( BetterError(message: e.toString(), stack: s.toString()), ); } } ``` -------------------------------- ### listUserTeams abstract method implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listUserTeams.html Defines the abstract method for fetching user teams via a GET request. ```dart @GET('/organization/list-user-teams') Future>> listUserTeams(); ``` -------------------------------- ### signIn abstract method implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_email_otp_email_otp_better_auth/EmailOtpBetterAuth/signIn.html Defines the POST endpoint for email OTP sign-in using the Better Auth package. ```dart @POST('/sign-in/email-otp') Future> signIn({ @BodyExtra('email') required String email, @BodyExtra('otp') required String otp, }); ``` -------------------------------- ### listRoles implementation in OrganizationRetrofit Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/listRoles.html Defines the GET request to retrieve organization roles with an optional organizationId query parameter. ```dart @GET('/organization/list-roles') Future>> listRoles({ @Query('organizationId') String? organizationId, }); ``` -------------------------------- ### OrganizationRetrofit(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/OrganizationRetrofit.html Initializes a new instance of the OrganizationRetrofit client. ```APIDOC ## OrganizationRetrofit Constructor ### Description Creates a new instance of the OrganizationRetrofit client using the provided Dio instance and optional configuration parameters. ### Signature `OrganizationRetrofit(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger})` ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String?) - Optional - The base URL for the API requests. - **errorLogger** (ParseErrorLogger?) - Optional - A logger instance for handling parsing errors. ``` -------------------------------- ### signIn method implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_magic_link_magic_link_better_auth/MagicLinkBetterAuth/signIn.html Defines the POST request structure for initiating a magic link sign-in process. ```dart @POST('/sign-in/magic-link') Future> signIn({ @BodyExtra('email') required String email, @BodyExtra('name') String? name, @BodyExtra('callbackURL') String? callbackURL, @BodyExtra('newUserCallbackURL') String? newUserCallbackURL, @BodyExtra('errorCallbackURL') String? errorCallbackURL, }); ``` -------------------------------- ### getRole Method Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/getRole.html Defines the Retrofit GET request for fetching organization roles with optional query parameters. ```dart @GET('/organization/get-role') Future> getRole({ @Query('organizationId') String? organizationId, @Query('roleName') String? roleName, @Query('roleId') String? roleId, }); ``` -------------------------------- ### SignUpResponse Constructor Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_models_sign_up_response_sign_up_response/SignUpResponse/SignUpResponse.html Defines the factory constructor for the SignUpResponse model using the _SignUpResponse implementation. ```dart const factory SignUpResponse({ String? token, required User user, @Default(true) bool status, }) = _SignUpResponse; ``` -------------------------------- ### fetchInvitation Retrofit Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_retrofit/OrganizationRetrofit/fetchInvitation.html Defines the GET request to retrieve an organization invitation using a query parameter for the ID. ```dart @GET('/organization/get-invitation') Future> fetchInvitation({ @Query('id') required String id, }); ``` -------------------------------- ### listAccounts abstract method definition Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_social_social_better_auth/SocialBetterAuth/listAccounts.html Defines the abstract method for retrieving social accounts using the @GET annotation. ```dart @GET('/list-accounts') Future>> listAccounts(); ``` -------------------------------- ### email(required String name, required String email, required String password, String? callbackURL) Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_sign_up_better_auth/SignUpBetterAuth-class.html Registers a new user using their name, email, and password. Returns a Future containing a Result with the SignUpResponse. ```APIDOC ## email ### Description Registers a new user with the provided credentials. ### Signature `Future> email({required String name, required String email, required String password, String? callbackURL})` ### Parameters - **name** (String) - Required - The user's name. - **email** (String) - Required - The user's email address. - **password** (String) - Required - The user's password. - **callbackURL** (String) - Optional - A URL to redirect to after sign-up. ``` -------------------------------- ### Accessing the signUp property Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_sign_up_sign_up_extension/SignUpBetterAuthExtension/signUp.html Retrieves an instance of SignUpBetterAuth using the global FlutterBetterAuth configuration. ```dart SignUpBetterAuth get signUp => SignUpBetterAuth( FlutterBetterAuth.dioClient, baseUrl: FlutterBetterAuth.baseUrl, ); ``` -------------------------------- ### getSession abstract method definition Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_better_auth_client/BetterAuthClient/getSession.html Defines the getSession method using the @GET annotation to map to the /get-session endpoint. ```dart @GET('/get-session') Future> getSession(); ``` -------------------------------- ### TwoFactorBetterAuth Constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_two_factor_two_factor_better_auth/TwoFactorBetterAuth/TwoFactorBetterAuth.html Initializes a new instance of the TwoFactorBetterAuth client. ```APIDOC ## TwoFactorBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new instance of the TwoFactorBetterAuth client. This factory constructor requires a Dio instance to handle network communication. ### Parameters - **dio** (Dio) - Required - The Dio instance used for API requests. - **baseUrl** (String?) - Optional - The base URL for the authentication service. - **errorLogger** (ParseErrorLogger?) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### Initialize OrganizationBetterAuth Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_organization_organization_better_auth/OrganizationBetterAuth/OrganizationBetterAuth.html The constructor requires a Dio instance and accepts an optional base URL to initialize the internal API client. ```dart OrganizationBetterAuth(this._dio, {String? baseUrl}) : _baseUrl = baseUrl, _api = OrganizationRetrofit(_dio, baseUrl: baseUrl); ``` -------------------------------- ### ApiKey property definitions Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_api_key_models_api_key/ApiKey/key.html Defines the core properties including id, name, start, prefix, and key for the ApiKey model. ```dart String get id; String? get name; String? get start; String? get prefix; String? get key; ``` -------------------------------- ### Generate One-Time Token Implementation Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_one_time_token_one_time_token_better_auth/OneTimeTokenBetterAuth/generate.html Defines the abstract method for generating a one-time token via a GET request. Requires an active authenticated session. ```dart @GET('/one-time-token/generate') Future> generate(); ``` -------------------------------- ### BetterAuthProvider Constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/presentation_better_auth_provider/BetterAuthProvider-class.html Initializes a new instance of the BetterAuthProvider widget. ```APIDOC ## BetterAuthProvider({Key? key, required Widget child}) ### Description Creates a BetterAuthProvider widget that wraps a child widget to provide authentication context. ### Parameters - **key** (Key?) - Optional - Controls how one widget replaces another widget in the tree. - **child** (Widget) - Required - The widget to be wrapped by this provider. ``` -------------------------------- ### MultiSessionBetterAuth constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_multi_session_multi_session_better_auth/MultiSessionBetterAuth/MultiSessionBetterAuth.html Initializes a new instance of the MultiSessionBetterAuth class. ```APIDOC ## MultiSessionBetterAuth(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger}) ### Description Creates a new instance of MultiSessionBetterAuth to manage authentication sessions using the provided Dio client. ### Parameters - **dio** (Dio) - Required - The Dio instance used for network requests. - **baseUrl** (String?) - Optional - The base URL for authentication requests. - **errorLogger** (ParseErrorLogger?) - Optional - A custom logger for handling parsing errors. ``` -------------------------------- ### listAccounts() Source: https://pub.dev/documentation/flutter_better_auth/latest/core_api_default_social_social_better_auth/SocialBetterAuth/listAccounts.html Retrieves a list of social accounts. This method performs a GET request to the /list-accounts endpoint and returns a Result containing a list of SocialAccountResponse objects. ```APIDOC ## GET /list-accounts ### Description Retrieves a list of social accounts associated with the current user. ### Method GET ### Endpoint /list-accounts ### Response #### Success Response (200) - **Result>** - A result object containing a list of social account responses. ``` -------------------------------- ### Initialize MagicLinkBetterAuth factory constructor Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_magic_link_magic_link_better_auth/MagicLinkBetterAuth/MagicLinkBetterAuth.html Use this factory constructor to instantiate the MagicLinkBetterAuth class with a Dio instance and optional configuration. ```dart factory MagicLinkBetterAuth( Dio dio, { String? baseUrl, ParseErrorLogger? errorLogger, }) = _MagicLinkBetterAuth; ``` -------------------------------- ### createUser Source: https://pub.dev/documentation/flutter_better_auth/latest/plugins_admin_admin_better_auth/AdminBetterAuth-class.html Creates a new user account. ```APIDOC ## createUser(String email, String password, String name, String? role, Map? data) ### Description Registers a new user in the system. ### Parameters - **email** (String) - Required - User email address. - **password** (String) - Required - User password. - **name** (String) - Required - User display name. - **role** (String) - Optional - Assigned role. - **data** (Map) - Optional - Additional user metadata. ```