new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · all subjects

plugins

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Extendable plugins for authentication

Better Auth can be extended using plugins such as username, magic link, passkey, and email-otp.

Plugin system architecture

Better Auth plugins require both server and client configuration. Server configuration adds routes and methods, client configuration adds methods accessible to the client. Database schema migrations are required after adding plugins.

Add plugin to server configuration

Import the plugin and pass it to the plugins array option in betterAuth configuration. For example, import twoFactor from 'better-auth/plugins' and add twoFactor() to the plugins array.

Migrate database after adding plugin

After adding a plugin to server configuration, run npx auth migrate to add required tables to the database, or npx auth generate to create the schema for manual migration.

Add plugin to client configuration

Import the plugin client version and pass it to the plugins array option in createAuthClient. For example, import twoFactorClient from 'better-auth/client/plugins' and configure with options like twoFactorPage.

Two factor plugin client methods

The twoFactorClient plugin provides these methods: twoFactor.enable(password), twoFactor.disable(password), and twoFactor.verifyTOTP({ code, trustDevice }) where trustDevice (boolean) prevents 2FA requirement on the same trusted device.

Give your agent this brain