{"id":30713045,"url":"https://github.com/kriasoft/better-auth","last_synced_at":"2026-02-23T03:14:18.515Z","repository":{"id":310803667,"uuid":"1041355633","full_name":"kriasoft/better-auth","owner":"kriasoft","description":"17 enterprise plugins for Better Auth - cloud storage, security, analytics \u0026 more","archived":false,"fork":false,"pushed_at":"2025-08-27T14:39:48.000Z","size":2010,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-27T23:43:39.141Z","etag":null,"topics":["authentication","better-auth","better-auth-plugin","byod","membership","organization","saas"],"latest_commit_sha":null,"homepage":"https://kriasoft.com/better-auth/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriasoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-20T11:16:02.000Z","updated_at":"2025-08-27T14:54:01.000Z","dependencies_parsed_at":"2025-08-20T11:22:41.244Z","dependency_job_id":"abb366ae-214d-4665-a16f-6fdff090d536","html_url":"https://github.com/kriasoft/better-auth","commit_stats":null,"previous_names":["kriasoft/better-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kriasoft/better-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fbetter-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fbetter-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fbetter-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fbetter-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriasoft","download_url":"https://codeload.github.com/kriasoft/better-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriasoft%2Fbetter-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273382058,"owners_count":25095372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","better-auth","better-auth-plugin","byod","membership","organization","saas"],"created_at":"2025-09-03T03:10:43.166Z","updated_at":"2025-10-24T10:17:25.853Z","avatar_url":"https://github.com/kriasoft.png","language":null,"funding_links":["https://github.com/sponsors/koistya"],"categories":[],"sub_categories":[],"readme":"# Better Auth Plugins\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/kriasoft/better-auth/pulls)\n[![Discord](https://img.shields.io/discord/643523529131950086?label=Discord\u0026logo=discord)](https://discord.gg/SBwX6VeqCY)\n[![Sponsor](https://img.shields.io/github/sponsors/koistya?label=Sponsor\u0026logo=github)](https://github.com/sponsors/koistya)\n\nA collection of modular plugins extending [Better Auth](https://better-auth.com) with specialized authentication features for modern TypeScript applications. Each plugin is designed to be lightweight, type-safe, and production-ready.\n\n## Available Plugins\n\n### Preview Release\n\n- **[`better-auth-feature-flags`](./plugins/feature-flags)** - Feature flags and gradual roll-outs with user targeting, A/B testing, and admin controls\n\n### In Active Development\n\n🚧 _The following plugins are currently under development:_\n\n- **Security \u0026 Compliance**: `abuse-detection`, `fraud-detection`, `compliance`, `backup-codes`\n- **User Management**: `impersonation`, `onboarding`, `session-management`, `subscription`\n- **Integrations**: `analytics`, `audit-log`, `connect`, `storage`, `webhooks`, `notifications`\n- **Access Control**: `rate-limit`, `consent`\n- **Development Tools**: `mcp`\n\n## Quick Start\n\n### Installation\n\nInstall Better Auth and the plugins you need:\n\n```bash\n# Using Bun (recommended)\nbun add better-auth better-call better-auth-feature-flags\n\n# Using npm\nnpm install better-auth better-call better-auth-feature-flags\n\n# Using pnpm\npnpm add better-auth better-call better-auth-feature-flags\n```\n\n#### Peer Dependencies\n\n- `better-auth` and `better-call` are peer dependencies.\n- `better-call` provides the API/middleware foundation used by Better Auth and this plugin. Better Auth depends on it and re-exports related types.\n- Installing both ensures version alignment and avoids resolution issues with strict package managers (e.g., pnpm).\n\n### Basic Setup\n\n```typescript\nimport { betterAuth } from \"better-auth\";\nimport { featureFlags } from \"better-auth-feature-flags\";\n\nexport const auth = betterAuth({\n  database: {\n    provider: \"postgresql\",\n    url: process.env.DATABASE_URL,\n  },\n  plugins: [\n    // Feature flags and access control\n    featureFlags({\n      // Optional static flags (server defaults)\n      flags: {\n        \"premium-features\": {\n          default: false,\n          enabled: false,\n        },\n        \"beta-ui\": {\n          default: false,\n          enabled: false,\n        },\n      },\n    }),\n  ],\n});\n```\n\n### Client Integration\n\n```typescript\nimport { createAuthClient } from \"better-auth/client\";\nimport { featureFlagsClient } from \"better-auth-feature-flags/client\";\n\nconst authClient = createAuthClient({\n  plugins: [featureFlagsClient()],\n});\n\n// Check feature flags (simple boolean checks)\nconst hasPremiumFeatures =\n  await authClient.featureFlags.isEnabled(\"premium-features\");\nconst canUseBetaUI = await authClient.featureFlags.isEnabled(\"beta-ui\");\n\n// Evaluate multiple flags efficiently\nconst flags = await authClient.featureFlags.evaluateMany([\n  \"premium-features\",\n  \"beta-ui\",\n  \"new-dashboard\",\n]);\n\n// Get all flags for current user\nconst allFlags = await authClient.featureFlags.bootstrap();\n\n// Track flag usage for analytics\nawait authClient.featureFlags.track(\"premium-features\", \"viewed\");\n\n// Admin operations (requires proper permissions)\nconst adminFlags = await authClient.featureFlags.admin.flags.list();\nawait authClient.featureFlags.admin.flags.create({\n  key: \"new-feature\",\n  name: \"New Feature\",\n  type: \"boolean\",\n  defaultValue: false,\n});\n\nif (hasPremiumFeatures) {\n  // Show premium features\n}\n```\n\n## Development\n\nThis monorepo uses Bun's built-in workspace support for managing all plugins.\n\n### Prerequisites\n\n- [Bun](https://bun.sh) \u003e= 1.0.0\n- Node.js \u003e= 20.0.0 (for compatibility)\n- PostgreSQL or compatible database\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/kriasoft/better-auth.git\ncd better-auth-plugins\n\n# Install dependencies\nbun install\n\n# Migrate the database\nbun run db:push\n\n# Build all packages\nbun run build\n\n# Run development mode\nbun run dev\n\n# Type check all packages\nbun run typecheck\n```\n\n### Database Commands\n\n```bash\nbun run db:studio         # Open Drizzle Studio (database GUI)\nbun run db:generate       # Generate migrations from schema changes\nbun run db:push           # Push schema changes (development)\nbun run db:migrate        # Run migrations (production)\n```\n\n### Project Structure\n\n```text\nbetter-auth-plugins/\n├── plugins/                # 18 standalone plugins\n│   ├── abuse-detection/    ├── analytics/         ├── audit-log/\n│   ├── backup-codes/       ├── compliance/        ├── connect/\n│   ├── consent/            ├── feature-flags/     ├── fraud-detection/\n│   ├── impersonation/      ├── mcp/               ├── notifications/\n│   ├── onboarding/         ├── rate-limit/        ├── session-management/\n│   ├── storage/            ├── subscription/      └── webhooks/\n├── apps/playground/        # Dev environment\n├── docs/                   # Documentation site\n└── test/                   # Test suites\n\nPlugin structure: src/{index,client,plugin,schema,types}.ts → tsup → dist/\n```\n\n## Vendor Dependencies\n\nThis project includes reference implementations as Git submodules in the `vendor/` directory. See [vendor/README.md](./vendor/README.md) for details and license information.\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](.github/CONTRIBUTING.md) for details.\n\n### Development Workflow\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests (`bun test`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to your branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## Support\n\n- 🎮 Discord: [Join our community](https://discord.gg/SBwX6VeqCY)\n- 💬 Discussions: [GitHub Discussions](https://github.com/kriasoft/better-auth/discussions)\n- 🐛 Issues: [GitHub Issues](https://github.com/kriasoft/better-auth/issues)\n- 💖 Sponsor: [GitHub Sponsors](https://github.com/sponsors/koistya)\n\n## License\n\nOpen source and free to use! This project is licensed under the MIT License - feel free to use it in your personal and commercial projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Fbetter-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriasoft%2Fbetter-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriasoft%2Fbetter-auth/lists"}