Repository navigation
Releases
lead@v0.7.0
better-auth-lead
Update to support better-auth v.1.7.0
Full Changelog: cap-captcha-v0.2.0...lead-v0.7.0
cap-captcha@v0.2.0
better-auth-cap-captcha
Update to support better-auth v1.7.0
Full Changelog: cookie-consent-v0.3.0...cap-captcha-v0.2.0
lead@0.6.2
What's Changed
- fix better auth compiler version by @marcjulian in #17
- update dev deps, pnpm and ci versions by @marcjulian in #18
Full Changelog: lead-v0.6.1...lead-v0.6.2
lead@0.6.1
Full Changelog: lead-v0.6.0...lead-v0.6.1
lead@0.6.0
What's Changed
- feat(lead): improve and add more admin routes by @marcjulian in #16
Full Changelog: cap-captcha-v0.1.0...lead-v0.6.0
cap-captcha-v0.1.0
better-auth-cap-catpcha
This plugin adds Captcha support for Cap and is based on the Better Auth Captcha Plugin.
Install the plugin
pnpm add better-auth-cap-captchaAdd the plugin to your betterAuth server instance. You set the providerUrl to your Cap instance URL and you can specify one ore more site keys with the secret.
export const auth = betterAuth({
plugins: [
capCaptcha({
providerUrl: "https://your-cap-instance",
siteKeys: {
"site-key-1": "secret-1",
"site-key-2": "secret-2",
},
}),
],
});The site key is extracted from the x-captcha-response token (format: siteKey:...:...), so the frontend widget determines which entry is used. No extra header needed.
await authClient.signIn.email({
email: "user@example.com",
password: "secure-password",
fetchOptions: {
headers: {
"x-captcha-response": capToken,
},
},
});Use the the Cap Widget or Programmatic mode to retrieve a token on the client.
Protecting other plugin endpoints
Pass endpoints to extend protection to routes from other plugins. Note that overriding endpoints replaces the defaults, so re-list the auth routes you still want protected:
import { betterAuth } from 'better-auth';
import { capCaptcha } from 'better-auth-cap-captcha';
import { lead } from 'better-auth-lead';
export const auth = betterAuth({
plugins: [
lead(),
capCaptcha({
providerUrl: 'https://cap.example.com',
siteKeys: {
'site-key-1': 'secret-1',
},
endpoints: [
'/sign-up/email',
'/sign-in/email',
'/request-password-reset',
// social
'/sign-in/social',
// lead plugin endpoints
'/lead/subscribe',
'/lead/resend',
],
}),
],
});Full Changelog: cookie-consent-v0.2.0...cap-captcha-v0.1.0
lead-v0.5.0
Breaking changes
This release includes breaking changes for the database schema and hooks in the server plugin.
The database schema is updated as following:
emailset to optionaluserIdadded as optional and unique as relation to the useremailVerifiedrenamed toconfirmedverificationEmailSentAtrenamed toconfirmationSentAt
The lead plugin options where updated too
sendVerificationEmailrenamed tosendConfirmationEmail-emailas additional parameter as for user leads the userId is usedonEmailVerifiedrenamed toonConfirmed
User-relation
A lead can now be either an email or connected to a user.
subscribe takes email as optional parameter, when the email is provided a lead is created with that email.
If the email is skipped, it checks for a valid user session and a lead is created for the user.
A lead, either email or user, needs to be confirmed.
Admin list endpoint
Adding a new option admin to enable a new list endpoint to fetch all leads. This endpoint checks if the admin plugin is available and verifies the user session to have one of the allowed roles.
Full Changelog: lead-v0.4.3...lead-v0.5.0
lead-v0.4.3
- allow unsubscribe to call without json body
Full Changelog: lead-v0.4.2...lead-v0.4.3