[GH-ISSUE #2034] [API Keys] Add lastUsed #9016

Closed
opened 2026-04-13 04:16:49 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @CodeWithShreyans on GitHub (Mar 28, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2034

Is this suited for github?

  • Yes, this is suited for github

Many apps show when an api key was last used, hence this would be a useful addition.

Describe the solution you'd like

Add a lastUsed column to the schema of type Date, set to null if key has never been used.

Describe alternatives you've considered

Adding it manually, but this can be cumbersome.

Additional context

No response

Originally created by @CodeWithShreyans on GitHub (Mar 28, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2034 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Many apps show when an api key was last used, hence this would be a useful addition. ### Describe the solution you'd like Add a lastUsed column to the schema of type Date, set to null if key has never been used. ### Describe alternatives you've considered Adding it manually, but this can be cumbersome. ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 04:16:49 -05:00
Author
Owner

@moshetanzer commented on GitHub (Mar 28, 2025):

Happy to implement @Bekacru any thoughts?

<!-- gh-comment-id:2761293239 --> @moshetanzer commented on GitHub (Mar 28, 2025): Happy to implement @Bekacru any thoughts?
Author
Owner

@Kinfe123 commented on GitHub (Apr 4, 2025):

Don't you think it is just somehow additional col mutation on db regarding on utilzing the col that we had with lastRequest.

<!-- gh-comment-id:2777692471 --> @Kinfe123 commented on GitHub (Apr 4, 2025): Don't you think it is just somehow additional col mutation on db regarding on utilzing the col that we had with `lastRequest`.
Author
Owner

@CodeWithShreyans commented on GitHub (May 28, 2025):

@Kinfe123 lastRequest seems to be always null

<!-- gh-comment-id:2917796269 --> @CodeWithShreyans commented on GitHub (May 28, 2025): @Kinfe123 lastRequest seems to be always null
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9016