Skip to content

API Key Management

This document introduces the API key management module in the ShipSaaS template.

  • 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

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.

For endpoints requiring authentication, read the API key from the request headers and call Better Auth’s auth.api.verifyApiKey to validate it.

Explore more related features: