npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

better-auth-compliance

v0.0.1

Published

Regional compliance and privacy plugin for Better Auth - GDPR, CCPA, and data protection automation

Readme

Better Auth Compliance

Regional compliance and privacy automation plugin for Better Auth. Handle GDPR, CCPA, and other data protection regulations with automated consent management and privacy controls.

🚧 Work in Progress

This package is currently under development. The compliance plugin will enable:

  • Consent Management - Cookie consent, data processing agreements
  • Data Rights - Right to access, deletion, portability, rectification
  • Regional Compliance - GDPR (EU), CCPA (California), LGPD (Brazil), PIPEDA (Canada)
  • Age Verification - COPPA compliance and parental consent
  • Data Residency - Store user data in specific regions
  • Privacy Controls - Automated PII handling and data minimization

Installation

bun add better-auth-compliance
# or
npm install better-auth-compliance

Setup

import { betterAuth } from "better-auth";
import { compliancePlugin } from "better-auth-compliance";

export const auth = betterAuth({
  plugins: [
    compliancePlugin({
      regulations: {
        gdpr: {
          enabled: true,
          consentRequired: true,
          dataRetention: 365, // days
          rightToDeletion: true,
          dataPortability: true
        },
        ccpa: {
          enabled: true,
          optOutRequired: true,
          doNotSell: true
        },
        coppa: {
          enabled: true,
          minimumAge: 13,
          parentalConsent: true
        }
      },
      consent: {
        cookie: {
          required: true,
          categories: ["necessary", "analytics", "marketing"],
          expiry: 365 // days
        },
        dataProcessing: {
          required: true,
          version: "1.0",
          updateNotification: true
        }
      },
      dataResidency: {
        enabled: true,
        defaultRegion: "us",
        userRegions: {
          eu: ["DE", "FR", "IT", "ES"],
          us: ["US", "CA", "MX"],
          apac: ["JP", "AU", "SG"]
        }
      },
      privacy: {
        anonymizeAfter: 730, // days
        encryptPII: true,
        minimizeData: true,
        auditAccess: true
      }
    })
  ]
});

Features (Planned)

Consent Management

  • Cookie consent banners with customization
  • Granular consent categories
  • Consent versioning and updates
  • Proof of consent storage
  • Withdrawal mechanisms
  • Cross-device consent sync

Data Rights Automation

  • Right to Access: Generate data export on request
  • Right to Deletion: Automated data purging
  • Right to Rectification: User data correction
  • Right to Portability: Export in machine-readable format
  • Right to Object: Opt-out of processing
  • Right to Restriction: Limit data processing

Regional Compliance

  • GDPR (European Union)

    • Lawful basis tracking
    • Data processing agreements
    • Cross-border transfer controls
  • CCPA/CPRA (California)

    • Do Not Sell mechanisms
    • Opt-out preferences
    • Financial incentive disclosures
  • Other Regulations

    • LGPD (Brazil)
    • PIPEDA (Canada)
    • POPIA (South Africa)
    • APP (Australia)

Age Verification

  • Age gate implementation
  • Parental consent flows
  • COPPA compliance
  • School consent (FERPA)
  • Mixed audience handling

Privacy Features

  • Automatic PII detection
  • Data minimization rules
  • Encryption at rest
  • Pseudonymization
  • Retention policies
  • Audit trails

Client Usage

import { createAuthClient } from "better-auth/client";
import { complianceClient } from "better-auth-compliance/client";

const authClient = createAuthClient({
  plugins: [complianceClient()]
});

// Manage consent
await authClient.compliance.updateConsent({
  cookies: {
    necessary: true,
    analytics: false,
    marketing: false
  },
  dataProcessing: true
});

// Exercise data rights
const myData = await authClient.compliance.requestDataExport();
await authClient.compliance.requestDeletion();

// Check compliance status
const status = await authClient.compliance.getComplianceStatus();

// Age verification
await authClient.compliance.verifyAge({
  birthDate: "2010-01-01",
  parentEmail: "[email protected]"
});

License

MIT