Better Auth UI v1.7.0 - API Keys Feature
We're excited to announce the release of Better Auth UI v1.7.0, which introduces a complete API key management system for your applications.
🔑 New Feature: API Keys
This release adds full API key management capabilities to Better Auth UI, allowing your users to create, view, and manage API keys for programmatic access to your services.
Key Features
- Create API Keys: Users can generate new API keys with custom names
- Expiration Settings: Set expiration periods or create non-expiring keys
- Secure Display: One-time secure display of newly created keys with copy functionality
- Key Management: View and manage existing keys from the user settings area
- Revocation: Easily revoke API keys when they're no longer needed
🚀 Getting Started with API Keys
To enable API keys in your application:
// 1. Configure your AuthUIProvider with API keys enabled
<AuthUIProvider
authClient={authClient}
apiKeys // Enable basic API keys
// Or with additional configuration:
// apiKeys={{
// prefix: "myapp", // Custom prefix for API keys
// metadata: { environment: "production" } // Add metadata to keys
// }}
>
{children}
</AuthUIProvider>
// 2. Manually Add the API Keys card to your settings page
import { APIKeysCard } from "@daveyplate/better-auth-ui";
function SettingsPage() {
return (
<div>
<h1>Account Settings</h1>
{/* Other setting cards */}
<APIKeysCard />
</div>
);
}
## 🛠️ Implementation Details
API keys include:
- Unique ID and name
- Secure key format with visible prefix
- Optional expiration dates
- Creation and update timestamps
## 🔐 Security Best Practices
- API keys are only shown once at creation time
- Keys can be easily revoked if compromised
- Consider setting expiration periods for sensitive access
---
As always, if you encounter any issues or have feedback, please let us know by opening an issue on GitHub. We appreciate your support!