docs/content/changelogs/1-2.mdx
To upgrade, run:
npm install [email protected]
Stripe integration for customer management, subscriptions, and webhooks.
npm install @better-auth/stripe
import { stripe } from "@better-auth/stripe"; // [!code highlight]
export const auth = betterAuth({
plugins: [
stripe({
// [!code highlight]
createCustomerOnSignup: true, // [!code highlight]
subscription: { // [!code highlight]
enabled: true, // [!code highlight]
plans: [// [!code highlight]
{ // [!code highlight]
name: "pro", // [!code highlight]
priceId: "price_1234567890", // [!code highlight]
}, // [!code highlight]
], // [!code highlight]
}, // [!code highlight]
}), // [!code highlight]
],
});
Read the Stripe Plugin docs for more information.
Protect your authentication flows with Google reCAPTCHA and Cloudflare Turnstile. Works for signup, signin, and password resets.
import { captcha } from "better-auth/plugins";
const auth = betterAuth({
plugins: [
// [!code highlight]
captcha({
// [!code highlight]
provider: "cloudflare-turnstile", // or "google-recaptcha" // [!code highlight]
secretKey: process.env.TURNSTILE_SECRET_KEY!, // [!code highlight]
}), // [!code highlight]
], // [!code highlight]
});
Read the Captcha Plugin docs for more information.
Generate and manage API keys with rate limiting, expiration, and metadata. Supports session creation from API keys.
import { apiKey } from "better-auth/plugins";
const auth = betterAuth({
plugins: [apiKey()],
});
Read the API Key Plugin docs for more information.
Organizations can now have teams or sub-organizations under them.
const auth = betterAuth({
plugins: [
organization({
teams: {
enabled: true,
},
}),
],
});
Read the Organization Plugin docs for more information.
The CLI now includes an init command to add Better Auth to your project.
npx auth init
displayName for case-insensitive lookups while preserving original formatting.adminUserIds option to grant specific users admin privileges. Learn moreWe rewrote better-call (the core library behind Better Auth) to fix TypeScript editor lag. Your IDE should now feel much snappier when working with Better Auth.
init CommandThe CLI now includes an init command to speed up setup:
A lot of fixes and refinements to make everything smoother, faster, and more reliable. Check out the changelog for more details.
npm install [email protected]
Upgrade now and take advantage of these powerful new features! 🚀