Skip to content

better-auth-tarjimArabic error messages for Better Auth

One line turns any Better Auth error into a clear Arabic toast. Typed, tiny, and always in sync with Better Auth.

better-auth-tarjim
error codes translated
262
plugins covered
15
synced Better Auth version
1.7.20
runtime dependencies
0

See it in action ​

Better Auth returns a stable error code. better-auth-tarjim looks it up and shows the Arabic message in a Sonner toast, in right-to-left.

error.code === "INVALID_EMAIL_OR_PASSWORD"
error.code === "EMAIL_NOT_VERIFIED"
error.code === "USER_ALREADY_EXISTS"
error.code === "SESSION_EXPIRED"

Quick start ​

bash
npm i better-auth-tarjim
tsx
import { authToast } from "better-auth-tarjim";

const { error } = await authClient.signIn.email({ email, password });
if (error) authToast(error); // البريد الإلكتروني أو كلمة المرور غير صحيحة

Add Sonner's <Toaster dir="rtl" /> once in your root layout. The getting started guide covers the full setup, and usage covers withAuthToast, overrides, and the Sonner-free entry point.

Why codes, not text? ​

Better Auth keeps its error codes stable while its English messages can change between releases. This package matches on codes only, so a wording change upstream can never break your Arabic messages. When Better Auth adds a code, the generated ErrorCode type changes and the build tells you exactly which translation is missing.

Unofficial package

better-auth-tarjim is a community project. It is not affiliated with Better Auth, and it is released under the MIT License.

Released under the MIT License. An unofficial community package, not affiliated with Better Auth.