Skip to content

Repository files navigation

better-auth

GitHub Actions Workflow StatusGitHub Release DateGitHub Release

PythonSwaggeropenapi initiative

API Reference for your Better Auth Instance

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.0
  • Package version: 0.0.1-beta13
  • 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:

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:

importbetter_auth

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importbetter_auth

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

importbetter_authfrombetter_auth.restimportApiExceptionfrompprintimportpprint# 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: bearerAuthconfiguration=better_auth.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API clientwithbetter_auth.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_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)
exceptApiExceptionase:
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

ClassMethodHTTP requestDescription
AdminApiadmin_ban_userPOST /admin/ban-user
AdminApiadmin_create_userPOST /admin/create-user
AdminApiadmin_get_userGET /admin/get-user
AdminApiadmin_has_permissionPOST /admin/has-permission
AdminApiadmin_impersonate_userPOST /admin/impersonate-user
AdminApiadmin_list_user_sessionsPOST /admin/list-user-sessions
AdminApiadmin_list_usersGET /admin/list-users
AdminApiadmin_remove_userPOST /admin/remove-user
AdminApiadmin_revoke_user_sessionPOST /admin/revoke-user-session
AdminApiadmin_revoke_user_sessionsPOST /admin/revoke-user-sessions
AdminApiadmin_set_user_passwordPOST /admin/set-user-password
AdminApiadmin_set_user_rolePOST /admin/set-role
AdminApiadmin_stop_impersonatingPOST /admin/stop-impersonating
AdminApiadmin_unban_userPOST /admin/unban-user
AdminApiadmin_update_userPOST /admin/update-user
ApiKeyApiapi_key_create_postPOST /api-key/create
ApiKeyApiapi_key_delete_postPOST /api-key/delete
ApiKeyApiapi_key_get_getGET /api-key/get
ApiKeyApiapi_key_list_getGET /api-key/list
ApiKeyApiapi_key_update_postPOST /api-key/update
DefaultApiaccount_info_getGET /account-info
DefaultApichange_emailPOST /change-email
DefaultApichange_passwordPOST /change-password
DefaultApidelete_userPOST /delete-user
DefaultApidelete_user_callback_getGET /delete-user/callback
DefaultApierror_getGET /error
DefaultApiforget_passwordPOST /request-password-reset
DefaultApiget_access_token_postPOST /get-access-token
DefaultApiget_sessionGET /get-session
DefaultApilink_social_accountPOST /link-social
DefaultApilist_user_accountsGET /list-accounts
DefaultApilist_user_sessionsGET /list-sessions
DefaultApiok_getGET /ok
DefaultApirefresh_token_postPOST /refresh-token
DefaultApireset_passwordPOST /reset-password
DefaultApireset_password_callbackGET /reset-password/{token}
DefaultApirevoke_other_sessions_postPOST /revoke-other-sessions
DefaultApirevoke_session_postPOST /revoke-session
DefaultApirevoke_sessions_postPOST /revoke-sessions
DefaultApisend_verification_emailPOST /send-verification-email
DefaultApisign_in_emailPOST /sign-in/email
DefaultApisign_outPOST /sign-out
DefaultApisign_up_with_email_and_passwordPOST /sign-up/email
DefaultApisocial_sign_inPOST /sign-in/social
DefaultApiunlink_account_postPOST /unlink-account
DefaultApiupdate_userPOST /update-user
DefaultApiverify_email_getGET /verify-email
OneTapApione_tap_callback_postPOST /one-tap/callback
PasskeyApigenerate_passkey_registration_optionsGET /passkey/generate-register-options
PasskeyApipasskey_delete_passkey_postPOST /passkey/delete-passkey
PasskeyApipasskey_generate_authenticate_optionsGET /passkey/generate-authenticate-options
PasskeyApipasskey_list_user_passkeys_getGET /passkey/list-user-passkeys
PasskeyApipasskey_update_passkey_postPOST /passkey/update-passkey
PasskeyApipasskey_verify_authenticationPOST /passkey/verify-authentication
PasskeyApipasskey_verify_registrationPOST /passkey/verify-registration
StripeApihandle_stripe_webhookPOST /stripe/webhook
TwoFactorApitwo_factor_disable_postPOST /two-factor/disable
TwoFactorApitwo_factor_enable_postPOST /two-factor/enable
TwoFactorApitwo_factor_generate_backup_codes_postPOST /two-factor/generate-backup-codes
TwoFactorApitwo_factor_get_totp_uri_postPOST /two-factor/get-totp-uri
TwoFactorApitwo_factor_send_otp_postPOST /two-factor/send-otp
TwoFactorApitwo_factor_verify_backup_code_postPOST /two-factor/verify-backup-code
TwoFactorApitwo_factor_verify_otp_postPOST /two-factor/verify-otp
TwoFactorApitwo_factor_verify_totp_postPOST /two-factor/verify-totp

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

apiKeyCookie

  • Type: API key
  • API key parameter name: apiKeyCookie
  • Location:

bearerAuth

  • Type: Bearer authentication

Author

chasenspace@gmail.com

About

python sdk for better-auth

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages