Skip to content

Memory

Source: packages/better-auth/src/Memory.ts Kind: Layer · Provides: BetterAuth.Database

In-memory database layer for Better Auth — tests and throwaway dev only. Data lives in the provided (or an internal) record for the lifetime of the process/isolate; nothing is persisted and there is no migration step (tables are seeded from the resolved auth schema).

import { BetterAuth, Memory } from "@alchemy.run/better-auth";
Effect.gen(function* () {
const auth = yield* BetterAuth({
emailAndPassword: { enabled: true },
secret: "test-secret",
});
const signUp = yield* auth.api.signUpEmail({
body: { email: "a@b.co", password: "password1234", name: "A" },
});
}).pipe(Effect.provide(Memory()))