API Key Management
This document introduces the API key management module in the ShipSaaS template.
Core Features
Section titled “Core Features”- Creation of API keys (supports custom names)
- Newly created keys are shown in full only once, and are masked in the list (prefix + ••••••)
- Displays a list of keys belonging to the current user (name, key prefix, creation time, expiration time)
- Deletion/revocation of API keys
Key Management Interface
Section titled “Key Management Interface”The key management interface is located under Settings → API Keys. It is only accessible to logged-in users and is used to manage API keys under the current account.
- Creating a Key: Click “Create API Key”, input a name, and confirm. Once created successfully, a popup will display the full key exactly once. Users are reminded to copy and save it immediately, as it cannot be viewed in full again after the popup is closed.
- List: A table displays the key name, masked key (e.g.,
key_••••••••••••), creation time, expiration time (displays “Never Expires” if not set), and other information. - Deletion: Revoke and remove a key via the row inline “Delete” action. Once deleted, the key becomes invalid immediately.
Verifying API Keys
Section titled “Verifying API Keys”For endpoints requiring authentication, read the API key from the request headers and call Better Auth’s auth.api.verifyApiKey to validate it.
Next Steps
Section titled “Next Steps”Explore more related features:
-
Authentication - Configure user authentication
-
User Management - User roles and ban management
-
Website Configuration - Configure core website settings
-
Database - Configure database