Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/better-auth-rs/better-auth-rs
/ functions
Functions
2,120 in github.com/better-auth-rs/better-auth-rs
⨍
Functions
2,120
◇
Types & classes
505
↓ 570 callers
Method
clone
(&self)
crates/core/src/plugin.rs:269
↓ 141 callers
Method
id
(&self)
crates/core/src/types_impls.rs:39
↓ 139 callers
Method
as_str
Return the SCREAMING_SNAKE_CASE string for this error code. Used by `handle_verify` to produce the structured JSON error response.
crates/api/src/plugins/api_key/mod.rs:81
↓ 124 callers
Function
send_request
( auth: &BetterAuth<MemoryDatabaseAdapter>, req: AuthRequest, )
tests/compat/helpers.rs:148
↓ 119 callers
Method
handle_request
Handle an authentication request. Errors from plugins and core handlers are automatically converted into standardized JSON responses via [`AuthError:
src/core/auth.rs:243
↓ 119 callers
Method
route
Add a single route entry.
crates/core/src/openapi.rs:66
↓ 97 callers
Method
with_email
(mut self, email: impl Into<String>)
crates/core/src/types.rs:403
↓ 93 callers
Method
with_name
(mut self, name: impl Into<String>)
crates/core/src/types.rs:408
↓ 80 callers
Method
to_context
Create an `AuthContext` for use with existing plugin handler methods.
crates/core/src/plugin.rs:291
↓ 79 callers
Method
plugin
Add a plugin to the authentication system.
src/core/auth.rs:126
↓ 74 callers
Method
get
(path: impl Into<String>, operation_id: impl Into<String>)
crates/core/src/plugin.rs:190
↓ 69 callers
Method
on_request
( &self, req: &AuthRequest, ctx: &AuthContext<DB>, )
crates/api/src/plugins/oauth/mod.rs:63
↓ 63 callers
Function
create_auth_request
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<serde_json::Value>, qu
crates/api/src/plugins/api_key/tests.rs:69
↓ 63 callers
Method
header
(&self, name: &str)
crates/core/src/types.rs:485
↓ 61 callers
Method
method
(&self)
crates/core/src/types.rs:477
↓ 58 callers
Function
validate_request_body
Validate a request body, returning a parsed + validated value or an error response.
crates/core/src/error.rs:271
↓ 57 callers
Method
create_user
(&self, mut user: CreateUser)
crates/core/src/hooks.rs:210
↓ 55 callers
Function
post_json_with_auth
(path: &str, body: Value, token: &str)
tests/compat/helpers.rs:114
↓ 51 callers
Method
text
(status: u16, text: impl Into<String>)
crates/core/src/types.rs:536
↓ 48 callers
Method
get_user_by_id
(&self, id: &str)
crates/core/src/hooks.rs:220
↓ 47 callers
Function
create_test_auth
()
tests/compat/helpers.rs:47
↓ 47 callers
Function
make_request
( method: HttpMethod, path: &str, token: &str, body: Option<serde_json::Value>, )
crates/api/src/plugins/admin/tests.rs:47
↓ 46 callers
Method
database
Set the database adapter, returning a [`TypedAuthBuilder`].
src/core/auth.rs:79
↓ 45 callers
Function
create_test_context_with_user
()
crates/api/src/plugins/api_key/tests.rs:8
↓ 44 callers
Method
create_session
Create a new session for a user
crates/core/src/session.rs:31
↓ 42 callers
Function
create_admin_context
()
crates/api/src/plugins/admin/tests.rs:11
↓ 41 callers
Function
create_test_context_with_user
()
crates/api/src/plugins/password_management/tests.rs:9
↓ 41 callers
Method
get
Build a GET request (with `origin` header).
tests/compat/helpers.rs:285
↓ 41 callers
Function
signup_user
( auth: &BetterAuth<MemoryDatabaseAdapter>, email: &str, password: &str, name: &str, )
tests/compat/helpers.rs:162
↓ 39 callers
Method
create_verification
( &self, mut verification: CreateVerification, )
crates/core/src/hooks.rs:367
↓ 38 callers
Function
create_test_auth_memory
Helper to create test BetterAuth instance with memory database
tests/integration_tests.rs:11
↓ 37 callers
Method
build
Build the final OpenAPI spec.
crates/core/src/openapi.rs:125
↓ 34 callers
Function
create_auth_request_no_query
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>,
crates/api/src/plugins/mod.rs:118
↓ 34 callers
Method
get_session
Get session by token
crates/core/src/session.rs:53
↓ 32 callers
Method
email
(&self)
crates/core/src/types_impls.rs:42
↓ 32 callers
Method
path
(&self)
crates/core/src/types.rs:481
↓ 31 callers
Method
build
Build the BetterAuth instance.
src/core/auth.rs:174
↓ 31 callers
Method
validate_endpoint
Validate a single endpoint response against the spec.
tests/compat/validator.rs:65
↓ 30 callers
Function
create_test_auth
Helper to create test BetterAuth instance with all plugins
tests/axum_integration_tests.rs:19
↓ 30 callers
Function
create_test_router
Helper to create the complete Axum router (mimics the example server)
tests/axum_integration_tests.rs:37
↓ 30 callers
Method
require_session
Extract a session token from the request, validate the session, and return the authenticated `(User, Session)` pair. This centralises the pattern pre
crates/core/src/plugin.rs:243
↓ 30 callers
Method
user_id
(&self)
crates/core/src/types_impls.rs:108
↓ 29 callers
Function
create_test_auth
()
src/tests/response_shape_tests.rs:25
↓ 29 callers
Function
json_body
(resp: &AuthResponse)
crates/api/src/plugins/admin/tests.rs:66
↓ 29 callers
Method
token
(&self)
crates/core/src/types_impls.rs:93
↓ 28 callers
Method
value
(&self)
crates/core/src/types_impls.rs:240
↓ 27 callers
Function
create_test_context
()
crates/api/src/plugins/mod.rs:38
↓ 27 callers
Method
get
(path: impl Into<String>, handler: impl Into<String>)
crates/better-auth-api/src/core/plugin.rs:114
↓ 27 callers
Method
get_user_by_email
(&self, email: &str)
crates/core/src/hooks.rs:224
↓ 26 callers
Function
post_json
(path: &str, body: Value)
tests/compat/helpers.rs:76
↓ 26 callers
Method
update_user
(&self, id: &str, mut update: UpdateUser)
crates/core/src/hooks.rs:232
↓ 25 callers
Function
get_with_auth
(path: &str, token: &str)
tests/compat/helpers.rs:93
↓ 25 callers
Method
into_response
Convert this error into a standardized [`AuthResponse`] matching the better-auth OpenAPI spec: `{ "message": "..." }`. Internal errors (500) use a ge
crates/core/src/error.rs:109
↓ 25 callers
Function
signup_user
Sign up a user and return (token, response_json).
src/tests/response_shape_tests.rs:66
↓ 24 callers
Method
get
(&self, key: &str)
crates/core/src/adapters/cache.rs:79
↓ 24 callers
Function
optionalPlugin
(name, ...factoryArgs)
scripts/generate-openapi-matrix.mjs:65
↓ 24 callers
Function
pushIf
(target, plugin)
scripts/generate-openapi-matrix.mjs:74
↓ 23 callers
Function
create_test_user_and_session
Helper to create user and get session token
tests/integration_tests.rs:16
↓ 23 callers
Method
default
()
crates/core/src/types.rs:440
↓ 23 callers
Method
handle_verify
( &self, req: &AuthRequest, ctx: &AuthContext<DB>, )
crates/api/src/plugins/api_key/mod.rs:549
↓ 23 callers
Method
role
(&self)
crates/core/src/types_impls.rs:69
↓ 23 callers
Method
session_manager
Create a `SessionManager` from this context's config and database.
crates/core/src/plugin.rs:234
↓ 22 callers
Function
config_with
(trusted: Vec<&str>)
crates/core/src/config.rs:831
↓ 22 callers
Method
delete_verification
(&self, id: &str)
crates/core/src/hooks.rs:410
↓ 22 callers
Method
table
()
crates/core/src/entity.rs:228
↓ 21 callers
Method
base_url
Set the base URL (e.g. `"https://myapp.com"`).
crates/core/src/config.rs:457
↓ 21 callers
Method
with_email_verified
(mut self, verified: bool)
crates/core/src/types.rs:413
↓ 20 callers
Function
create_auth_json_request_no_query
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<serde_json
crates/api/src/plugins/mod.rs:127
↓ 20 callers
Method
organization_id
(&self)
crates/core/src/types_impls.rs:192
↓ 20 callers
Function
post_json
(path: &str, body: serde_json::Value)
src/tests/response_shape_tests.rs:39
↓ 20 callers
Method
with_header
(mut self, name: impl Into<String>, value: impl Into<String>)
crates/core/src/types.rs:548
↓ 19 callers
Function
create_key_and_get_raw
Helper: create a key and return (id, raw_key)
crates/api/src/plugins/api_key/tests.rs:113
↓ 19 callers
Method
enable_signup
(mut self, enable: bool)
crates/api/src/plugins/email_password.rs:149
↓ 19 callers
Function
json_body
(response: &AuthResponse)
crates/api/src/plugins/api_key/tests.rs:90
↓ 19 callers
Function
post_json_with_auth
(path: &str, body: serde_json::Value, token: &str)
src/tests/response_shape_tests.rs:58
↓ 19 callers
Function
require_session
Helper function to require authenticated session
crates/api/src/plugins/organization/handlers/mod.rs:20
↓ 19 callers
Method
status
(&self)
crates/core/src/types_impls.rs:219
↓ 17 callers
Method
create_account
(&self, mut account: CreateAccount)
crates/core/src/hooks.rs:315
↓ 17 callers
Function
create_auth_request
(method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>)
crates/better-auth-api/src/plugins/password_management.rs:621
↓ 17 callers
Method
expires_at
(&self)
crates/core/src/types_impls.rs:90
↓ 17 callers
Method
get_user_accounts
(&self, user_id: &str)
crates/core/src/hooks.rs:333
↓ 17 callers
Function
send
Helper: send a request through the auth handler
examples/basic_usage.rs:269
↓ 16 callers
Function
create_session_cookie
Build a `Set-Cookie` header value for a session token using the `cookie` crate for correct formatting and escaping.
crates/core/src/utils/cookie_utils.rs:12
↓ 16 callers
Function
create_test_context_with_user
()
crates/better-auth-api/src/plugins/password_management.rs:579
↓ 16 callers
Function
create_test_user
Helper to create a user and return user data + session token
tests/axum_integration_tests.rs:62
↓ 16 callers
Method
get_member
( &self, organization_id: &str, user_id: &str, )
crates/core/src/hooks.rs:466
↓ 16 callers
Method
password_min_length
Set the minimum password length.
crates/core/src/config.rs:531
↓ 15 callers
Method
as_str
(self)
scripts/sync_better_auth_openapi.rs:62
↓ 13 callers
Method
body_as_json
(&self)
crates/core/src/types.rs:506
↓ 13 callers
Function
create_full_auth
Create a test auth instance with all currently implemented plugins.
tests/compatibility_tests.rs:51
↓ 13 callers
Method
get_user_sessions
(&self, user_id: &str)
crates/core/src/hooks.rs:270
↓ 13 callers
Method
parse
(s: &str)
crates/api/src/plugins/organization/rbac.rs:12
↓ 13 callers
Method
with_hook
(mut self, hook: Arc<dyn DatabaseHooks<DB>>)
crates/core/src/hooks.rs:148
↓ 12 callers
Function
create_auth_with_apikey
Helper: create auth with ApiKeyPlugin and return auth + session token
tests/integration_tests.rs:1671
↓ 12 callers
Method
delete_session
Delete a session
crates/core/src/session.rs:136
↓ 12 callers
Method
delete_user_sessions
Delete all sessions for a user
crates/core/src/session.rs:142
↓ 12 callers
Function
get_request
(path: &str)
tests/compat/helpers.rs:86
↓ 12 callers
Method
get_verification_by_identifier
( &self, identifier: &str, )
crates/core/src/hooks.rs:395
↓ 12 callers
Method
session_cookie
Build a `Set-Cookie` header value for a session token.
crates/core/src/plugin.rs:298
↓ 11 callers
Function
create_auth_request
(method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>)
crates/better-auth-api/src/plugins/session_management.rs:368
next →
1–100 of 2,120, ranked by callers