Skip to content

Releases

lead@v0.7.0

Choose a tag to compare

@marcjulian marcjulian released this 18 Sep 09:41

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

Choose a tag to compare

@marcjulian marcjulian released this 18 Sep 09:32

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

Choose a tag to compare

@marcjulian marcjulian released this 21 Aug 09:23

What's Changed

Full Changelog: lead-v0.6.1...lead-v0.6.2

lead@0.6.1

Choose a tag to compare

@marcjulian marcjulian released this 21 Aug 09:22

lead@0.6.0

Choose a tag to compare

@marcjulian marcjulian released this 19 Aug 14:25

What's Changed

Full Changelog: cap-captcha-v0.1.0...lead-v0.6.0

cap-captcha-v0.1.0

Choose a tag to compare

@marcjulian marcjulian released this 09 Jul 19:50

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-captcha

Add 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

Choose a tag to compare

@marcjulian marcjulian released this 04 Jun 09:12

Breaking changes

This release includes breaking changes for the database schema and hooks in the server plugin.

The database schema is updated as following:

  • email set to optional
  • userId added as optional and unique as relation to the user
  • emailVerified renamed to confirmed
  • verificationEmailSentAt renamed to confirmationSentAt

The lead plugin options where updated too

  • sendVerificationEmail renamed to sendConfirmationEmail - email as additional parameter as for user leads the userId is used
  • onEmailVerified renamed to onConfirmed

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

Choose a tag to compare

@marcjulian marcjulian released this 04 Jun 09:05
  • allow unsubscribe to call without json body

Full Changelog: lead-v0.4.2...lead-v0.4.3