# better-auth

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/chasenlab/better-auth-python/ci.yml)
![GitHub Release Date](https://img.shields.io/github/release-date/chasenlab/better-auth-python)
![GitHub Release](https://img.shields.io/github/v/release/chasenlab/better-auth-python?&color=fff)

![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)
![openapi initiative](https://img.shields.io/badge/openapiinitiative-%23000000.svg?style=for-the-badge&logo=openapiinitiative&logoColor=white)

API Reference for your Better Auth Instance

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.1.0
- Package version: 0.0.1-beta11
- Generator version: 7.17.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.9+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install better-auth
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/chasenlab/better-auth-python.git`)

Then import the package:
```python
import better_auth
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import better_auth
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import better_auth
from better_auth.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000/api/auth
# See configuration.py for a list of all supported configuration parameters.
configuration = better_auth.Configuration(
    host = "http://localhost:3000/api/auth" # Replace with your API server host
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = better_auth.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with better_auth.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = better_auth.AdminApi(api_client)
    admin_ban_user_request = better_auth.AdminBanUserRequest() # AdminBanUserRequest | 

    try:
        api_response = api_instance.admin_ban_user(admin_ban_user_request)
        print("The response of AdminApi->admin_ban_user:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AdminApi->admin_ban_user: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *http://localhost:3000/api/auth*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AdminApi* | [**admin_ban_user**](docs/AdminApi.md#admin_ban_user) | **POST** /admin/ban-user | 
*AdminApi* | [**admin_create_user**](docs/AdminApi.md#admin_create_user) | **POST** /admin/create-user | 
*AdminApi* | [**admin_get_user**](docs/AdminApi.md#admin_get_user) | **GET** /admin/get-user | 
*AdminApi* | [**admin_has_permission**](docs/AdminApi.md#admin_has_permission) | **POST** /admin/has-permission | 
*AdminApi* | [**admin_impersonate_user**](docs/AdminApi.md#admin_impersonate_user) | **POST** /admin/impersonate-user | 
*AdminApi* | [**admin_list_user_sessions**](docs/AdminApi.md#admin_list_user_sessions) | **POST** /admin/list-user-sessions | 
*AdminApi* | [**admin_list_users**](docs/AdminApi.md#admin_list_users) | **GET** /admin/list-users | 
*AdminApi* | [**admin_remove_user**](docs/AdminApi.md#admin_remove_user) | **POST** /admin/remove-user | 
*AdminApi* | [**admin_revoke_user_session**](docs/AdminApi.md#admin_revoke_user_session) | **POST** /admin/revoke-user-session | 
*AdminApi* | [**admin_revoke_user_sessions**](docs/AdminApi.md#admin_revoke_user_sessions) | **POST** /admin/revoke-user-sessions | 
*AdminApi* | [**admin_set_user_password**](docs/AdminApi.md#admin_set_user_password) | **POST** /admin/set-user-password | 
*AdminApi* | [**admin_set_user_role**](docs/AdminApi.md#admin_set_user_role) | **POST** /admin/set-role | 
*AdminApi* | [**admin_stop_impersonating**](docs/AdminApi.md#admin_stop_impersonating) | **POST** /admin/stop-impersonating | 
*AdminApi* | [**admin_unban_user**](docs/AdminApi.md#admin_unban_user) | **POST** /admin/unban-user | 
*AdminApi* | [**admin_update_user**](docs/AdminApi.md#admin_update_user) | **POST** /admin/update-user | 
*ApiKeyApi* | [**api_key_create_post**](docs/ApiKeyApi.md#api_key_create_post) | **POST** /api-key/create | 
*ApiKeyApi* | [**api_key_delete_post**](docs/ApiKeyApi.md#api_key_delete_post) | **POST** /api-key/delete | 
*ApiKeyApi* | [**api_key_get_get**](docs/ApiKeyApi.md#api_key_get_get) | **GET** /api-key/get | 
*ApiKeyApi* | [**api_key_list_get**](docs/ApiKeyApi.md#api_key_list_get) | **GET** /api-key/list | 
*ApiKeyApi* | [**api_key_update_post**](docs/ApiKeyApi.md#api_key_update_post) | **POST** /api-key/update | 
*DefaultApi* | [**account_info_get**](docs/DefaultApi.md#account_info_get) | **GET** /account-info | 
*DefaultApi* | [**change_email**](docs/DefaultApi.md#change_email) | **POST** /change-email | 
*DefaultApi* | [**change_password**](docs/DefaultApi.md#change_password) | **POST** /change-password | 
*DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **POST** /delete-user | 
*DefaultApi* | [**delete_user_callback_get**](docs/DefaultApi.md#delete_user_callback_get) | **GET** /delete-user/callback | 
*DefaultApi* | [**error_get**](docs/DefaultApi.md#error_get) | **GET** /error | 
*DefaultApi* | [**forget_password**](docs/DefaultApi.md#forget_password) | **POST** /request-password-reset | 
*DefaultApi* | [**get_access_token_post**](docs/DefaultApi.md#get_access_token_post) | **POST** /get-access-token | 
*DefaultApi* | [**get_session**](docs/DefaultApi.md#get_session) | **GET** /get-session | 
*DefaultApi* | [**link_social_account**](docs/DefaultApi.md#link_social_account) | **POST** /link-social | 
*DefaultApi* | [**list_user_accounts**](docs/DefaultApi.md#list_user_accounts) | **GET** /list-accounts | 
*DefaultApi* | [**list_user_sessions**](docs/DefaultApi.md#list_user_sessions) | **GET** /list-sessions | 
*DefaultApi* | [**ok_get**](docs/DefaultApi.md#ok_get) | **GET** /ok | 
*DefaultApi* | [**refresh_token_post**](docs/DefaultApi.md#refresh_token_post) | **POST** /refresh-token | 
*DefaultApi* | [**reset_password**](docs/DefaultApi.md#reset_password) | **POST** /reset-password | 
*DefaultApi* | [**reset_password_callback**](docs/DefaultApi.md#reset_password_callback) | **GET** /reset-password/{token} | 
*DefaultApi* | [**revoke_other_sessions_post**](docs/DefaultApi.md#revoke_other_sessions_post) | **POST** /revoke-other-sessions | 
*DefaultApi* | [**revoke_session_post**](docs/DefaultApi.md#revoke_session_post) | **POST** /revoke-session | 
*DefaultApi* | [**revoke_sessions_post**](docs/DefaultApi.md#revoke_sessions_post) | **POST** /revoke-sessions | 
*DefaultApi* | [**send_verification_email**](docs/DefaultApi.md#send_verification_email) | **POST** /send-verification-email | 
*DefaultApi* | [**sign_in_email**](docs/DefaultApi.md#sign_in_email) | **POST** /sign-in/email | 
*DefaultApi* | [**sign_out**](docs/DefaultApi.md#sign_out) | **POST** /sign-out | 
*DefaultApi* | [**sign_up_with_email_and_password**](docs/DefaultApi.md#sign_up_with_email_and_password) | **POST** /sign-up/email | 
*DefaultApi* | [**social_sign_in**](docs/DefaultApi.md#social_sign_in) | **POST** /sign-in/social | 
*DefaultApi* | [**unlink_account_post**](docs/DefaultApi.md#unlink_account_post) | **POST** /unlink-account | 
*DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **POST** /update-user | 
*DefaultApi* | [**verify_email_get**](docs/DefaultApi.md#verify_email_get) | **GET** /verify-email | 
*OneTapApi* | [**one_tap_callback_post**](docs/OneTapApi.md#one_tap_callback_post) | **POST** /one-tap/callback | 
*PasskeyApi* | [**generate_passkey_registration_options**](docs/PasskeyApi.md#generate_passkey_registration_options) | **GET** /passkey/generate-register-options | 
*PasskeyApi* | [**passkey_delete_passkey_post**](docs/PasskeyApi.md#passkey_delete_passkey_post) | **POST** /passkey/delete-passkey | 
*PasskeyApi* | [**passkey_generate_authenticate_options**](docs/PasskeyApi.md#passkey_generate_authenticate_options) | **GET** /passkey/generate-authenticate-options | 
*PasskeyApi* | [**passkey_list_user_passkeys_get**](docs/PasskeyApi.md#passkey_list_user_passkeys_get) | **GET** /passkey/list-user-passkeys | 
*PasskeyApi* | [**passkey_update_passkey_post**](docs/PasskeyApi.md#passkey_update_passkey_post) | **POST** /passkey/update-passkey | 
*PasskeyApi* | [**passkey_verify_authentication**](docs/PasskeyApi.md#passkey_verify_authentication) | **POST** /passkey/verify-authentication | 
*PasskeyApi* | [**passkey_verify_registration**](docs/PasskeyApi.md#passkey_verify_registration) | **POST** /passkey/verify-registration | 
*StripeApi* | [**handle_stripe_webhook**](docs/StripeApi.md#handle_stripe_webhook) | **POST** /stripe/webhook | 
*TwoFactorApi* | [**two_factor_disable_post**](docs/TwoFactorApi.md#two_factor_disable_post) | **POST** /two-factor/disable | 
*TwoFactorApi* | [**two_factor_enable_post**](docs/TwoFactorApi.md#two_factor_enable_post) | **POST** /two-factor/enable | 
*TwoFactorApi* | [**two_factor_generate_backup_codes_post**](docs/TwoFactorApi.md#two_factor_generate_backup_codes_post) | **POST** /two-factor/generate-backup-codes | 
*TwoFactorApi* | [**two_factor_get_totp_uri_post**](docs/TwoFactorApi.md#two_factor_get_totp_uri_post) | **POST** /two-factor/get-totp-uri | 
*TwoFactorApi* | [**two_factor_send_otp_post**](docs/TwoFactorApi.md#two_factor_send_otp_post) | **POST** /two-factor/send-otp | 
*TwoFactorApi* | [**two_factor_verify_backup_code_post**](docs/TwoFactorApi.md#two_factor_verify_backup_code_post) | **POST** /two-factor/verify-backup-code | 
*TwoFactorApi* | [**two_factor_verify_otp_post**](docs/TwoFactorApi.md#two_factor_verify_otp_post) | **POST** /two-factor/verify-otp | 
*TwoFactorApi* | [**two_factor_verify_totp_post**](docs/TwoFactorApi.md#two_factor_verify_totp_post) | **POST** /two-factor/verify-totp | 


## Documentation For Models

 - [Account](docs/Account.md)
 - [AccountInfoGet200Response](docs/AccountInfoGet200Response.md)
 - [AccountInfoGet200ResponseUser](docs/AccountInfoGet200ResponseUser.md)
 - [AdminBanUserRequest](docs/AdminBanUserRequest.md)
 - [AdminCreateUserRequest](docs/AdminCreateUserRequest.md)
 - [AdminHasPermission200Response](docs/AdminHasPermission200Response.md)
 - [AdminHasPermissionRequest](docs/AdminHasPermissionRequest.md)
 - [AdminListUserSessions200Response](docs/AdminListUserSessions200Response.md)
 - [AdminListUserSessionsRequest](docs/AdminListUserSessionsRequest.md)
 - [AdminListUsers200Response](docs/AdminListUsers200Response.md)
 - [AdminRevokeUserSessionRequest](docs/AdminRevokeUserSessionRequest.md)
 - [AdminSetUserPasswordRequest](docs/AdminSetUserPasswordRequest.md)
 - [AdminSetUserRoleRequest](docs/AdminSetUserRoleRequest.md)
 - [AdminUpdateUserRequest](docs/AdminUpdateUserRequest.md)
 - [ApiKeyCreatePost200Response](docs/ApiKeyCreatePost200Response.md)
 - [ApiKeyCreatePostRequest](docs/ApiKeyCreatePostRequest.md)
 - [ApiKeyDeletePost200Response](docs/ApiKeyDeletePost200Response.md)
 - [ApiKeyDeletePostRequest](docs/ApiKeyDeletePostRequest.md)
 - [ApiKeyGetGet200Response](docs/ApiKeyGetGet200Response.md)
 - [ApiKeyListGet200ResponseInner](docs/ApiKeyListGet200ResponseInner.md)
 - [ApiKeyUpdatePostRequest](docs/ApiKeyUpdatePostRequest.md)
 - [Apikey](docs/Apikey.md)
 - [ChangeEmail200Response](docs/ChangeEmail200Response.md)
 - [ChangeEmailRequest](docs/ChangeEmailRequest.md)
 - [ChangePassword200Response](docs/ChangePassword200Response.md)
 - [ChangePasswordRequest](docs/ChangePasswordRequest.md)
 - [DeleteUser200Response](docs/DeleteUser200Response.md)
 - [DeleteUserCallbackGet200Response](docs/DeleteUserCallbackGet200Response.md)
 - [DeleteUserRequest](docs/DeleteUserRequest.md)
 - [ForgetPassword200Response](docs/ForgetPassword200Response.md)
 - [ForgetPasswordRequest](docs/ForgetPasswordRequest.md)
 - [GeneratePasskeyRegistrationOptions200Response](docs/GeneratePasskeyRegistrationOptions200Response.md)
 - [GeneratePasskeyRegistrationOptions200ResponseAuthenticatorSelection](docs/GeneratePasskeyRegistrationOptions200ResponseAuthenticatorSelection.md)
 - [GeneratePasskeyRegistrationOptions200ResponseExcludeCredentialsInner](docs/GeneratePasskeyRegistrationOptions200ResponseExcludeCredentialsInner.md)
 - [GeneratePasskeyRegistrationOptions200ResponsePubKeyCredParamsInner](docs/GeneratePasskeyRegistrationOptions200ResponsePubKeyCredParamsInner.md)
 - [GeneratePasskeyRegistrationOptions200ResponseRp](docs/GeneratePasskeyRegistrationOptions200ResponseRp.md)
 - [GeneratePasskeyRegistrationOptions200ResponseUser](docs/GeneratePasskeyRegistrationOptions200ResponseUser.md)
 - [GetSession200Response](docs/GetSession200Response.md)
 - [LinkSocialAccount200Response](docs/LinkSocialAccount200Response.md)
 - [LinkSocialAccountRequest](docs/LinkSocialAccountRequest.md)
 - [LinkSocialAccountRequestIdToken](docs/LinkSocialAccountRequestIdToken.md)
 - [ListUserAccounts200ResponseInner](docs/ListUserAccounts200ResponseInner.md)
 - [OkGet200Response](docs/OkGet200Response.md)
 - [OneTapCallbackPost200Response](docs/OneTapCallbackPost200Response.md)
 - [OneTapCallbackPostRequest](docs/OneTapCallbackPostRequest.md)
 - [Passkey](docs/Passkey.md)
 - [PasskeyDeletePasskeyPost200Response](docs/PasskeyDeletePasskeyPost200Response.md)
 - [PasskeyDeletePasskeyPostRequest](docs/PasskeyDeletePasskeyPostRequest.md)
 - [PasskeyGenerateAuthenticateOptions200Response](docs/PasskeyGenerateAuthenticateOptions200Response.md)
 - [PasskeyUpdatePasskeyPost200Response](docs/PasskeyUpdatePasskeyPost200Response.md)
 - [PasskeyUpdatePasskeyPostRequest](docs/PasskeyUpdatePasskeyPostRequest.md)
 - [PasskeyVerifyAuthenticationRequest](docs/PasskeyVerifyAuthenticationRequest.md)
 - [PasskeyVerifyRegistrationRequest](docs/PasskeyVerifyRegistrationRequest.md)
 - [RefreshTokenPost200Response](docs/RefreshTokenPost200Response.md)
 - [RefreshTokenPostRequest](docs/RefreshTokenPostRequest.md)
 - [ResetPassword200Response](docs/ResetPassword200Response.md)
 - [ResetPasswordCallback200Response](docs/ResetPasswordCallback200Response.md)
 - [ResetPasswordRequest](docs/ResetPasswordRequest.md)
 - [RevokeOtherSessionsPost200Response](docs/RevokeOtherSessionsPost200Response.md)
 - [RevokeSessionPost200Response](docs/RevokeSessionPost200Response.md)
 - [RevokeSessionPostRequest](docs/RevokeSessionPostRequest.md)
 - [RevokeSessionsPost200Response](docs/RevokeSessionsPost200Response.md)
 - [SendVerificationEmail200Response](docs/SendVerificationEmail200Response.md)
 - [SendVerificationEmail400Response](docs/SendVerificationEmail400Response.md)
 - [SendVerificationEmailRequest](docs/SendVerificationEmailRequest.md)
 - [Session](docs/Session.md)
 - [SignInEmail200Response](docs/SignInEmail200Response.md)
 - [SignInEmailRequest](docs/SignInEmailRequest.md)
 - [SignOut200Response](docs/SignOut200Response.md)
 - [SignUpWithEmailAndPassword200Response](docs/SignUpWithEmailAndPassword200Response.md)
 - [SignUpWithEmailAndPassword200ResponseUser](docs/SignUpWithEmailAndPassword200ResponseUser.md)
 - [SignUpWithEmailAndPasswordRequest](docs/SignUpWithEmailAndPasswordRequest.md)
 - [SocialSignIn200Response](docs/SocialSignIn200Response.md)
 - [SocialSignIn400Response](docs/SocialSignIn400Response.md)
 - [SocialSignIn403Response](docs/SocialSignIn403Response.md)
 - [SocialSignInRequest](docs/SocialSignInRequest.md)
 - [SocialSignInRequestIdToken](docs/SocialSignInRequestIdToken.md)
 - [TwoFactor](docs/TwoFactor.md)
 - [TwoFactorEnablePost200Response](docs/TwoFactorEnablePost200Response.md)
 - [TwoFactorEnablePostRequest](docs/TwoFactorEnablePostRequest.md)
 - [TwoFactorGenerateBackupCodesPost200Response](docs/TwoFactorGenerateBackupCodesPost200Response.md)
 - [TwoFactorGenerateBackupCodesPostRequest](docs/TwoFactorGenerateBackupCodesPostRequest.md)
 - [TwoFactorGetTotpUriPost200Response](docs/TwoFactorGetTotpUriPost200Response.md)
 - [TwoFactorGetTotpUriPostRequest](docs/TwoFactorGetTotpUriPostRequest.md)
 - [TwoFactorVerifyBackupCodePost200Response](docs/TwoFactorVerifyBackupCodePost200Response.md)
 - [TwoFactorVerifyBackupCodePost200ResponseSession](docs/TwoFactorVerifyBackupCodePost200ResponseSession.md)
 - [TwoFactorVerifyBackupCodePost200ResponseUser](docs/TwoFactorVerifyBackupCodePost200ResponseUser.md)
 - [TwoFactorVerifyBackupCodePostRequest](docs/TwoFactorVerifyBackupCodePostRequest.md)
 - [TwoFactorVerifyOtpPost200Response](docs/TwoFactorVerifyOtpPost200Response.md)
 - [TwoFactorVerifyOtpPost200ResponseUser](docs/TwoFactorVerifyOtpPost200ResponseUser.md)
 - [TwoFactorVerifyOtpPostRequest](docs/TwoFactorVerifyOtpPostRequest.md)
 - [TwoFactorVerifyTotpPostRequest](docs/TwoFactorVerifyTotpPostRequest.md)
 - [UnlinkAccountPostRequest](docs/UnlinkAccountPostRequest.md)
 - [UpdateUser200Response](docs/UpdateUser200Response.md)
 - [UpdateUserRequest](docs/UpdateUserRequest.md)
 - [User](docs/User.md)
 - [Verification](docs/Verification.md)
 - [VerifyEmailGet200Response](docs/VerifyEmailGet200Response.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="apiKeyCookie"></a>
### apiKeyCookie

- **Type**: API key
- **API key parameter name**: apiKeyCookie
- **Location**: 

<a id="bearerAuth"></a>
### bearerAuth

- **Type**: Bearer authentication


## Author

chasenspace@gmail.com


