### Getting Started with APIKeysApi Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/README.md Demonstrates how to instantiate the APIKeysApi and create an API key. Ensure you configure HTTP Bearer authorization before making requests. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = APIKeysApi(); final createApiKeyRequest = CreateApiKeyRequest(); // CreateApiKeyRequest | try { final result = api_instance.createApiKey(createApiKeyRequest); print(result); } catch (e) { print('Exception when calling APIKeysApi->createApiKey: $e\n'); } ``` -------------------------------- ### Retrieve Role Set - Dart Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/RoleSetsApi.md Provides an example of how to fetch a specific role set using its key or ID. ```dart // TODO // final api_instance = RoleSetsApi(); // final roleSetKeyOrId = "roleSetKeyOrId_example"; // String | The key or ID of the role set // // try { // final result = api_instance.getRoleSet(roleSetKeyOrId); // print(result); // } catch (e) { // print('Exception when calling RoleSetsApi->getRoleSet: $e\n'); // } ``` -------------------------------- ### Install Application Bundle Components Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_flutter/example/linux/CMakeLists.txt Defines the installation rules for creating a relocatable application bundle. This includes installing the executable, ICU data, the Flutter library, bundled plugin libraries, and native assets. ```cmake install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install Flutter Assets in CMakeLists.txt Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_flutter/example/linux/CMakeLists.txt Configures the installation of Flutter assets, including removing existing assets and installing new ones to the bundle data directory. This is part of the Runtime component. ```cmake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install( CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Create Organization Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationsApi.md Demonstrates how to create a new organization with optional details. Ensure your authentication token is correctly configured. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = OrganizationsApi(); final createOrganizationRequest = CreateOrganizationRequest(); // CreateOrganizationRequest | try { final result = api_instance.createOrganization(createOrganizationRequest); print(result); } catch (e) { print('Exception when calling OrganizationsApi->createOrganization: $e\n'); } ``` -------------------------------- ### End-to-End Release Flow Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/tools/new_release/README.md Demonstrates the sequence of commands for performing a release from a release branch and then on the main branch. ```bash # ── On a release branch ────────────────────────────────────────────────── # Bump patch, keep the -beta suffix melos run new_release -- patch --pre=beta # 0.0.16-beta → 0.0.17-beta # Or graduate to a stable release (drop beta, bump minor) melos run new_release -- minor # 0.0.17-beta → 0.1.0 # Review the generated diff, then open a PR git diff HEAD~1 git push origin release/0.0.17-beta # ── On main, after the PR is merged ────────────────────────────────────── git checkout main && git pull melos run tag # creates 4 tags and pushes → triggers pub.dev publish workflow ``` -------------------------------- ### OAuthApplicationsApi - listOAuthApplications Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/README.md Get a list of OAuth applications for an instance. ```APIDOC ## GET /oauth_applications ### Description Get a list of OAuth applications for an instance. ### Method GET ### Endpoint /oauth_applications ``` -------------------------------- ### getInstanceProtect Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/InstanceSettingsApi.md Get instance protect settings. ```APIDOC ## GET /instance/protect ### Description Get instance protect settings. ### Method GET ### Endpoint /instance/protect ### Parameters This endpoint does not need any parameters. ### Response #### Success Response (200) - **InstanceProtect** (InstanceProtect) - Description of the InstanceProtect model ### Request Example ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = InstanceSettingsApi(); try { final result = api_instance.getInstanceProtect(); print(result); } catch (e) { print('Exception when calling InstanceSettingsApi->getInstanceProtect: $e\n'); } ``` ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### Create API Key Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/README.md This example demonstrates how to create a new API key using the `APIKeysApi`. Ensure you have configured the `bearerAuth` with your access token. ```APIDOC ## Create API Key ### Description Creates a new API key for your Clerk instance. ### Method POST ### Endpoint /v1/api-keys ### Parameters #### Request Body - **createApiKeyRequest** (CreateApiKeyRequest) - Required - The request body for creating an API key. ### Request Example ```dart import 'package:openapi/api.dart'; final api_instance = APIKeysApi(); final createApiKeyRequest = CreateApiKeyRequest(); try { final result = api_instance.createApiKey(createApiKeyRequest); print(result); } catch (e) { print('Exception when calling APIKeysApi->createApiKey: $e\n'); } ``` ### Response #### Success Response (200) - **apiKey** (ApiKey) - The created API key object. #### Response Example ```json { "id": "key_123abc", "key": "sk_test_...", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### List Instance Organization Invitations Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationInvitationsApi.md Get a list of organization invitations for the current instance. ```APIDOC ## GET /organization_invitations ### Description Get a list of organization invitations for the current instance. ### Method GET ### Endpoint /organization_invitations ### Parameters #### Query Parameters - **limit** (Integer) - Optional - Number of invitations to return per page. - **offset** (Integer) - Optional - The offset for the invitations list. ### Response #### Success Response (200) - **OrganizationInvitationList** (OrganizationInvitationList) - A list of organization invitations ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Accept**: application/json ``` -------------------------------- ### List OAuth Applications Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OAuthApplicationsApi.md Get a list of OAuth applications for an instance. ```APIDOC ## GET /oauth_applications ### Description Get a list of OAuth applications for an instance ### Method GET ### Endpoint /oauth_applications ### Response #### Success Response (200) - **List** (List) - ### Request Example ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = OAuthApplicationsApi(); try { final result = api_instance.listOAuthApplications(); print(result); } catch (e) { print('Exception when calling OAuthApplicationsApi->listOAuthApplications: $e\n'); } ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Example Tags Created by `melos run tag` Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/tools/new_release/README.md Illustrates the format of the annotated tags created by the `tag` script for different packages and a global tag. ```text clerk_auth-v0.0.17-beta clerk_backend_api-v0.0.17-beta clerk_flutter-v0.0.17-beta v0.0.17-beta ← global tag, triggers the pub.dev publish workflow ``` -------------------------------- ### Get Instance Protect Settings Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/InstanceSettingsApi.md Retrieve the protect settings for the current instance. Authentication is required. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = InstanceSettingsApi(); try { final result = api_instance.getInstanceProtect(); print(result); } catch (e) { print('Exception when calling InstanceSettingsApi->getInstanceProtect: $e\n'); } ``` -------------------------------- ### Get Organization Details - Dart Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationsApi.md Retrieve an organization's details using its ID or slug. This example shows how to optionally include member counts and elevated permission flags. Ensure bearer token authentication is configured. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = OrganizationsApi(); final organizationId = organizationId_example; // String | The ID or slug of the organization final includeMembersCount = true; // bool | Flag to denote whether or not the organization's members count should be included in the response. final includeMissingMemberWithElevatedPermissions = true; // bool | Flag to denote whether or not to include a member with elevated permissions who is not currently a member of the organization. try { final result = api_instance.getOrganization(organizationId, includeMembersCount, includeMissingMemberWithElevatedPermissions); print(result); } catch (e) { print('Exception when calling OrganizationsApi->getOrganization: $e\n'); } ``` -------------------------------- ### Install AOT Library Conditionally in CMakeLists.txt Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_flutter/example/linux/CMakeLists.txt Installs the AOT (Ahead-Of-Time compilation) library to the bundle library directory. This installation is conditional and only occurs on non-Debug builds, also as part of the Runtime component. ```cmake # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Initialize and Configure UsersApi Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/UsersApi.md Demonstrates how to initialize the UsersApi and set up authentication using an access token. This is a prerequisite for making any authenticated API calls. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = UsersApi(); final emailAddress = []; // List | Counts users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored. final phoneNumber = []; // List | Counts users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored. final externalId = []; // List | Counts users with the specified external IDs. Accepts up to 100 external IDs. Any external IDs not found are ignored. final username = []; // List | Counts users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored. final web3Wallet = []; // List | Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addresses not found are ignored. final userId = []; // List | Counts users with the user IDs specified. Accepts up to 100 user IDs. Any user IDs not found are ignored. final organizationId = []; // List | Returns users that have memberships to the given organizations. For each organization ID, the `+` and `-` can be prepended to the ID, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization IDs. final query = query_example; // String | Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user IDs, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. final emailAddressQuery = emailAddressQuery_example; // String | Counts users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`, and will be included in the resulting count. final phoneNumberQuery = phoneNumberQuery_example; // String | Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`, and will be included in the resulting count. final usernameQuery = usernameQuery_example; // String | Counts users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`, and will be included in the resulting count. final nameQuery = nameQuery_example; // String | Returns users with names that match the given query, via case-insensitive partial match. final banned = true; // bool | Counts users which are either banned (`banned=true`) or not banned (`banned=false`). final lastActiveAtBefore = 1700690400000; // int | Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. final lastActiveAtAfter = 1700690400000; // int | Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. final lastActiveAtSince = 1700690400000; // int | Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of `last_active_at_after`. final createdAtBefore = 1730160000000; // int | Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. final createdAtAfter = 1730160000000; // int | Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. final lastSignInAtBefore = 1700690400000; // int | Counts users whose last sign-in was before the given date (with millisecond precision). Example: use 1700690400000 to count users whose last sign-in was before 2023-11-23. final lastSignInAtAfter = 1700690400000; // int | Counts users whose last sign-in was after the given date (with millisecond precision). Example: use 1700690400000 to count users whose last sign-in was after 2023-11-23. ``` -------------------------------- ### Create Role Set - Dart Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/RoleSetsApi.md Shows how to create a new role set with specified roles and configurations. The role set key must be unique and follow a specific format. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = RoleSetsApi(); final createRoleSetRequest = CreateRoleSetRequest(); // CreateRoleSetRequest | try { final result = api_instance.createRoleSet(createRoleSetRequest); print(result); } catch (e) { print('Exception when calling RoleSetsApi->createRoleSet: $e\n'); } ``` -------------------------------- ### getInstance Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/InstanceSettingsApi.md Fetch the current instance settings. ```APIDOC ## GET /instance ### Description Fetch the current instance. Fetches the current instance ### Method GET ### Endpoint /instance ### Parameters This endpoint does not need any parameters. ### Response #### Success Response (200) - **Instance** (Instance) - Description of the Instance model ### Request Example ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = InstanceSettingsApi(); try { final result = api_instance.getInstance(); print(result); } catch (e) { print('Exception when calling InstanceSettingsApi->getInstance: $e\n'); } ``` ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### listOrganizations Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationsApi.md Get a list of organizations for an instance. ```APIDOC ## GET /organizations ### Description Get a list of organizations for an instance. ### Method GET ### Endpoint /organizations ### Parameters #### Query Parameters - **limit** (int) - Optional - Number of organizations to return per page. - **offset** (int) - Optional - The offset into the list of organizations. - **order_by** (string) - Optional - Order organizations by `created_at` or `updated_at` fields. - **order_direction** (string) - Optional - Direction of ordering. Possible values are `asc` and `desc`. ### Response #### Success Response (200) - **List<Organization>** (List<Organization>) - A list of organization objects. ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### Initialize Clerk Auth and Authenticate User Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_auth/README.md Demonstrates how to initialize the Clerk Auth object with configuration and API keys, attempt user sign-in using email and password, print the authenticated user, and sign out. It also shows how to manage cache directories for different environments. ```dart import 'dart:io'; import 'package:clerk_auth/clerk_auth.dart'; Future main() async { final auth = Auth( config: const AuthConfig( publishableKey: '', ), persistor: DefaultPersistor( getCacheDirectory: () => Directory.current, ), // To enable running of the example in e.g. Flutter environments where // [Directory.current] causes problems, use the `clerk_flutter` package and // use: // persistor: DefaultCachingPersistor( // getCacheDirectory: getApplicationDocumentsDirectory, // ) // Which will use the correct directory for the platform your Flutter app // is running on. You can also implement a bespoke [Persistor] specific // to your applications storage mechanism, // // or replace the above line with... // persistor: Persistor.none, ); await auth.initialize(); await auth.attemptSignIn( strategy: Strategy.password, identifier: '', password: '', ); print('Signed in as ${auth.user}'); await auth.signOut(); auth.terminate(); } ``` -------------------------------- ### MachinesApi - listMachines Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/README.md Get a list of machines for an instance. ```APIDOC ## GET /machines ### Description Get a list of machines for an instance. ### Method GET ### Endpoint /machines ``` -------------------------------- ### getUsersCount Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/UsersApi.md Get the total count of users in the Clerk instance. ```APIDOC ## GET /users/count ### Description Get the total count of users in the Clerk instance. ### Method GET ### Endpoint /users/count ### Response #### Success Response (200) - **Object** (Object) - An object containing the user count, e.g., `{"total_count": 100}` #### Response Example ```json { "example": "{\"total_count\": 100}" } ``` ``` -------------------------------- ### Example App Integration with ClerkAuth Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_flutter/README.md Demonstrates how to wrap your MaterialApp with ClerkAuth to configure the SDK using your publishable key and set up basic authentication flows with ClerkUserButton and ClerkAuthentication. ```dart /// Example App class ExampleApp extends StatelessWidget { /// Constructs an instance of Example App const ExampleApp({super.key, required this.publishableKey}); /// Publishable Key final String publishableKey; @override Widget build(BuildContext context) { return ClerkAuth( config: ClerkAuthConfig(publishableKey: publishableKey), child: MaterialApp( theme: ThemeData.light(), debugShowCheckedModeBanner: false, home: Scaffold( body: SafeArea( child: ClerkErrorListener( child: ClerkAuthBuilder( signedInBuilder: (context, authState) { return const ClerkUserButton(); }, signedOutBuilder: (context, authState) { return const ClerkAuthentication(); }, ), ), ), ), ), ); } } ``` -------------------------------- ### List Role Sets Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/RoleSetsApi.md Get a list of role sets. ```APIDOC ## GET /role_sets ### Description Get a list of role sets. ### Method GET ### Endpoint /role_sets ### Response #### Success Response (200) - **List** (List) - Description of the returned list of RoleSet objects ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Accept**: application/json ``` -------------------------------- ### List Organization Invitations Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationInvitationsApi.md Get a list of organization invitations. ```APIDOC ## GET /organizations/{organization_id}/invitations ### Description Get a list of organization invitations. ### Method GET ### Endpoint /organizations/{organization_id}/invitations ### Parameters #### Path Parameters - **organization_id** (String) - Required - The ID of the organization for which to retrieve invitations #### Query Parameters - **limit** (Integer) - Optional - Number of invitations to return per page. - **offset** (Integer) - Optional - The offset for the invitations list. ### Response #### Success Response (200) - **OrganizationInvitationList** (OrganizationInvitationList) - A list of organization invitations ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Accept**: application/json ``` -------------------------------- ### New Release Script Usage Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/tools/new_release/README.md Shows how to use the `new_release` script with different bump types and pre-release options. ```bash melos run new_release -- [--pre=] ``` -------------------------------- ### Get Organization Invitation Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationInvitationsApi.md Retrieve an organization invitation by ID. ```APIDOC ## GET /organizations/{organization_id}/invitations/{invitation_id} ### Description Retrieve an organization invitation by ID. ### Method GET ### Endpoint /organizations/{organization_id}/invitations/{invitation_id} ### Parameters #### Path Parameters - **organization_id** (String) - Required - The ID of the organization for which to retrieve the invitation - **invitation_id** (String) - Required - The ID of the invitation to retrieve ### Response #### Success Response (200) - **OrganizationInvitation** (OrganizationInvitation) - The organization invitation object ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Accept**: application/json ``` -------------------------------- ### Create Session Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/SessionsApi.md Demonstrates how to create a new active session. This operation is intended for testing purposes only and is not available for production instances. For production, consider using Sign-in Tokens. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = SessionsApi(); final createSessionRequest = CreateSessionRequest(); // CreateSessionRequest | try { final result = api_instance.createSession(createSessionRequest); print(result); } catch (e) { print('Exception when calling SessionsApi->createSession: $e\n'); } ``` -------------------------------- ### Tag Script Usage Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/tools/new_release/README.md Demonstrates the command to run the `tag` script, which creates and pushes annotated tags. ```bash melos run tag ``` -------------------------------- ### Create Session Token Example Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/SessionsApi.md Shows how to create a session JSON Web Token (JWT) based on an existing session ID. Ensure to configure authentication before making the call. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = SessionsApi(); final sessionId = sessionId_example; // String | The ID of the session final createSessionTokenRequest = CreateSessionTokenRequest(); // CreateSessionTokenRequest | try { final result = api_instance.createSessionToken(sessionId, createSessionTokenRequest); print(result); } catch (e) { print('Exception when calling SessionsApi->createSessionToken: $e\n'); } ``` -------------------------------- ### Get SAML Connection Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/SAMLConnectionsApi.md Retrieves a specific SAML Connection by its ID. ```APIDOC ## GET /saml_connections/{saml_connection_id} ### Description Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. ### Method GET ### Endpoint /saml_connections/{saml_connection_id} ### Parameters #### Path Parameters - **samlConnectionId** (String) - Required - The ID of the SAML Connection to retrieve. ### Response #### Success Response (200) - **SchemasSAMLConnection** (SchemasSAMLConnection) - The requested SAML Connection object. ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### listOrganizations Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationsApi.md Get a list of organizations for an instance. Results can be paginated and filtered. ```APIDOC ## GET /organizations ### Description Get a list of organizations for an instance. Results can be paginated using the optional `limit` and `offset` query parameters. The organizations are ordered by descending creation date. ### Method GET ### Endpoint /organizations ### Parameters #### Query Parameters - **includeMembersCount** (Boolean) - Optional - Include the count of members for each organization. - **includeMissingMemberWithElevatedPermissions** (Boolean) - Optional - Include organizations where the current user has elevated permissions but is not a member. - **query** (String) - Optional - Search organizations by name. - **userId** (String) - Optional - Filter organizations by a specific user ID. - **organizationId** (String) - Optional - Filter organizations by a specific organization ID. - **orderBy** (String) - Optional - Order the results by a specific field. - **limit** (Integer) - Optional - The maximum number of organizations to return. - **offset** (Integer) - Optional - The number of organizations to skip before returning results. ### Response #### Success Response (200) - **Organizations** (Organizations) - A list of organizations. ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### Get Organization Permission Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OrganizationPermissionsApi.md Retrieves a specific organization permission by its ID. ```APIDOC ## GET Organization Permissions ### Description Retrieves a specific organization permission by its ID. ### Method GET ### Endpoint /organizationPermissions/{permissionId} ### Parameters #### Path Parameters - **permissionId** (String) - Required - The ID of the permission to retrieve ### Response #### Success Response (200) - **Permission** (Permission) - Details of the retrieved permission ### Request Example ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = OrganizationPermissionsApi(); final permissionId = permissionId_example; // String | The ID of the permission to retrieve try { final result = api_instance.getOrganizationPermission(permissionId); print(result); } catch (e) { print('Exception when calling OrganizationPermissionsApi->getOrganizationPermission: $e\n'); } ``` ``` -------------------------------- ### createMachine Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/MachinesApi.md Creates a new machine. Requires authentication. ```APIDOC ## POST /machines ### Description Create a machine Creates a new machine. ### Method POST ### Endpoint /machines ### Parameters #### Request Body - **createMachineRequest** (CreateMachineRequest) - Optional - The request body for creating a machine. ### Response #### Success Response (200) - **CreateMachine200Response** (CreateMachine200Response) - The response object upon successful creation of a machine. ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### Get OAuth Application Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/OAuthApplicationsApi.md Retrieves a specific OAuth application by its ID. ```APIDOC ## GET /oauth_applications/{oauthApplicationId} ### Description Retrieves a specific OAuth application by its ID. ### Method GET ### Endpoint /oauth_applications/{oauthApplicationId} ### Parameters #### Path Parameters - **oauthApplicationId** (String) - Required - The ID of the OAuth application ### Response #### Success Response (200) - **OAuthApplication** (OAuthApplication) - Details of the OAuth application ### Authorization [bearerAuth](../README.md#bearerAuth) ``` -------------------------------- ### Retrieve Users with Various Filters (Dart) Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/UsersApi.md Demonstrates how to fetch users by specifying multiple criteria such as email addresses, phone numbers, external IDs, usernames, web3 wallets, user IDs, organization IDs, and various query parameters. It also shows how to filter by banned status and activity/creation timestamps. ```dart import 'package:openapi/api.dart'; // TODO Configure HTTP Bearer authorization: bearerAuth // Case 1. Use String Token //defaultApiClient.getAuthentication('bearerAuth').setAccessToken('YOUR_ACCESS_TOKEN'); // Case 2. Use Function which generate token. // String yourTokenGeneratorFunction() { ... } //defaultApiClient.getAuthentication('bearerAuth').setAccessToken(yourTokenGeneratorFunction); final api_instance = UsersApi(); final emailAddress = []; // List | Returns users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored. final phoneNumber = []; // List | Returns users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored. final externalId = []; // List | Returns users with the specified external IDs. For each external ID, the `+` and `-` can be prepended to the ID, which denote whether the respective external ID should be included or excluded from the result set. Accepts up to 100 external IDs. Any external IDs not found are ignored. final username = []; // List | Returns users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored. final web3Wallet = []; // List | Returns users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addresses not found are ignored. final userId = []; // List | Returns users with the user IDs specified. For each user ID, the `+` and `-` can be prepended to the ID, which denote whether the respective user ID should be included or excluded from the result set. Accepts up to 100 user IDs. Any user IDs not found are ignored. final organizationId = []; // List | Returns users that have memberships to the given organizations. For each organization ID, the `+` and `-` can be prepended to the ID, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization IDs. final query = query_example; // String | Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user IDs, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. final emailAddressQuery = emailAddressQuery_example; // String | Returns users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. final phoneNumberQuery = phoneNumberQuery_example; // String | Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. final usernameQuery = usernameQuery_example; // String | Returns users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. final nameQuery = nameQuery_example; // String | Returns users with names that match the given query, via case-insensitive partial match. final banned = true; // bool | Returns users which are either banned (`banned=true`) or not banned (`banned=false`). final lastActiveAtBefore = 1700690400000; // int | Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. final lastActiveAtAfter = 1700690400000; // int | Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. final lastActiveAtSince = 1700690400000; // int | Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of `last_active_at_after`. final createdAtBefore = 1730160000000; // int | Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. final createdAtAfter = 1730160000000; // int | Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. final lastSignInAtBefore = 1700690400000; // int | Returns users whose last sign-in was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last sign-in was before 2023-11-23. ``` -------------------------------- ### Add Dependency Libraries and Include Directories Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_flutter/example/windows/runner/CMakeLists.txt Links necessary libraries and specifies include directories for the project. Add any application-specific dependencies here to ensure they are available during the build process. ```cmake # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### OrganizationDomainsApi - listOrganizationDomains Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/README.md Get a list of all domains associated with a specific organization. ```APIDOC ## GET /organizations/{organization_id}/domains ### Description Get a list of all domains of an organization. ### Method GET ### Endpoint /organizations/{organization_id}/domains ``` -------------------------------- ### Run Coverage for All Packages Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/TESTING.md Execute this command to run coverage tests for all packages within the project. ```shell melos run coverage ``` -------------------------------- ### SignUp Model Properties Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/SignUp.md This snippet outlines the available properties for the SignUp model, including their types and descriptions. ```APIDOC ## SignUp Model ### Description Represents a user's sign-up attempt, containing information about the process and user details. ### Properties - **object** (String): The type of the object. - **id** (String): The unique identifier for the sign-up attempt. - **status** (String): The current status of the sign-up attempt. - **requiredFields** (List): A list of fields that are required for sign-up. - **optionalFields** (List): A list of fields that are optional for sign-up. - **missingFields** (List): A list of fields that are missing for the sign-up. - **unverifiedFields** (List): A list of fields that are unverified. - **verifications** (SignUpVerifications): An object containing verification details. - **username** (String): The username provided during sign-up. - **emailAddress** (String): The email address provided during sign-up. - **phoneNumber** (String): The phone number provided during sign-up. - **web3Wallet** (String): The Web3 wallet address provided during sign-up. - **passwordEnabled** (bool): Indicates if password authentication is enabled. - **firstName** (String): The first name provided during sign-up. - **lastName** (String): The last name provided during sign-up. - **unsafeMetadata** (Map): Unsafe metadata associated with the sign-up (optional). - **publicMetadata** (Map): Public metadata associated with the sign-up (optional). - **customAction** (bool): Indicates if a custom action is involved. - **externalId** (String): An external identifier for the sign-up. - **createdSessionId** (String): The ID of the session created upon sign-up. - **createdUserId** (String): The ID of the user created upon sign-up. - **abandonAt** (int): Unix timestamp at which the user abandoned the sign-up attempt. - **legalAcceptedAt** (int): Unix timestamp at which the user accepted the legal requirements. - **locale** (String): The user locale preference for the sign-up (BCP-47 language tag) (optional). - **externalAccount** (Object): External account information (optional). ### Load the model package ```dart import 'package:openapi/api.dart'; ``` ``` -------------------------------- ### Get Billing Statement Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/BillingApi.md Retrieves a specific billing statement by its ID. ```APIDOC ## GET /billing/statements/{statementID} ### Description Retrieves a specific billing statement by its ID. ### Method GET ### Endpoint /billing/statements/{statementID} ### Parameters #### Path Parameters - **statementID** (String) - Required - The ID of the statement to retrieve. ### Response #### Success Response (200) - **BillingStatement** (BillingStatement) - Details of the billing statement. ### Request Example ```dart import 'package:openapi/api.dart'; final api_instance = BillingApi(); final statementID = 'your_statement_id'; try { final result = api_instance.getBillingStatement(statementID); print(result); } catch (e) { print('Exception when calling BillingApi->getBillingStatement: $e\n'); } ``` ``` -------------------------------- ### createUser Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/UsersApi.md Create a new user account. ```APIDOC ## POST /users ### Description Create a new user account. ### Method POST ### Endpoint /users ### Parameters #### Request Body - **firstName** (String) - Optional - User's first name - **lastName** (String) - Optional - User's last name - **emailAddress** (String) - Optional - User's email address - **phoneNumber** (String) - Optional - User's phone number - **password** (String) - Optional - User's password - **username** (String) - Optional - User's username - **externalId** (String) - Optional - User's external ID - **unsafeMetadata** (Object) - Optional - User's metadata ### Request Example ```json { "example": "request body for creating a user" } ``` ### Response #### Success Response (200) - **User** (User) - The created user object #### Response Example ```json { "example": "created user object" } ``` ``` -------------------------------- ### Get Role Set Source: https://github.com/clerk/clerk-sdk-flutter/blob/main/packages/clerk_backend_api/doc/RoleSetsApi.md Retrieves an existing role set by its key or ID. ```APIDOC ## GET /role_sets/{role_set_key_or_id} ### Description Retrieves an existing role set by its key or ID. ### Method GET ### Endpoint /role_sets/{role_set_key_or_id} ### Parameters #### Path Parameters - **roleSetKeyOrId** (String) - Required - The key or ID of the role set ### Response #### Success Response (200) - **RoleSet** (RoleSet) - Description of the returned RoleSet object ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Accept**: application/json ```