// snippet import removed // snippet import removed // snippet import removed // snippet import removed
In this guide, we will be focusing on tracking new user sign-ups for a SaaS application that uses Better Auth for user authentication.
Installation
•
Install the @dub/better-auth plugin
To get started, simply install the @dub/better-auth plugin via your preferred package manager:
npm install @dub/better-auth•
Configure the plugin
Then, add the plugin to your better-auth config file:
import { dubAnalytics } from "@dub/better-auth";
import { betterAuth } from "better-auth";
import { Dub } from "dub";
const dub = new Dub();
export const auth = betterAuth({
plugins: [
dubAnalytics({
dubClient: dub,
}),
],
});