Personal API Key Table Component - PropelAuth Docs
Personal API Key Table Component
PropelAuth's Personal API Key Table Component allows you to customize the UI around managing and deleting a user's personal API Keys. For more information on API Keys, check out our docs here.
Personal API Keys
| Name | Key ID | Created | Expires | |
|---|---|---|---|---|
| My API Key | 80d51e93a891... | 6/4/2026, 9:35:55 PM | Never | … Update NameDelete |
| My API Key | c575c0751162... | 6/4/2026, 9:35:55 PM | Never | … Update NameDelete |
Shadcn Installation
Install this component from our shadcn registry.
npx shadcn@latest add https://components.propelauth.com/r/personal-api-key-table.json
Reference APIs
These are the APIs that are used by the above component. You can use these APIs directly in your own code.
fetchPersonalApiKeys
Fetches a paginated list of the user's API keys. This will not return the full API key, just the Key ID, expiration, created at, and metadata.
Arguments
- Name
page_numberType number Description The page number to return. Starts at 0. - Name
page_sizeType number Description The amount of results per page. - Name
api_key_searchType string Description Filter by Key ID. - Name
sort_byType string Description Can be one of the following: 'CreatedAtAsc' | 'CreatedAtDesc' | 'ExpiresAtAsc' | 'ExpiresAtDesc'
Success Response
- Name
api_keysType PersonalApiKey[] Description
An array of API Keys belonging to the logged in user.
display_namestring | nullapi_key_idstringcreated_atnumberexpires_at_secondsnumber | nullmetadataobject | null
Name
total_api_keysType number Description The total amount of API keys belonging to the user.Name
current_pageType number Description The current page.Name
page_sizeType number Description The maximum amount of results of the page.Name
has_more_resultsType boolean Description Returns true if there are more results beyond the current page.
Response Functions
The response object has a handle function that you can use to handle the response. These functions can be async, and you can return values from them.
- Name
successDescription Successful request. - Name
personalApiKeysDisabledDescription API keys are not enabled in your PropelAuth project. - Name
badRequestDescription Incorrect arguments provided. - Name
unauthorizedDescription The user is not logged in. - Name
unexpectedOrUnhandledDescription An unexpected error occurred.
Request
const { fetchPersonalApiKeys } = useAuthFrontendApis()
const response = await fetchPersonalApiKeys({
page_number: 0,
page_size: 10,
api_key_search: '1189c444-8a...',
})
await response.handle({
success: (data) => {
console.log(data)
},
personalApiKeysDisabled(error) {
console.error('Personal API keys are disabled', error.user_facing_error)
},
badRequest(error) {
for (const [field, fieldErrorMessage] of Object.entries(error.user_facing_errors)) {
console.log('Error: "