feat: Introduce user latest session activity date and allow ordering & filtering when listing users #2261
Conversation
🦋 Changeset detectedLatest commit: 422e36c The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
LekoArts
left a comment
There was a problem hiding this comment.
Please add a description to your PR explaining what it does. Thanks!
| ## How to use | ||
|
|
||
| Works on Node.js `>=18.18.0` (or later) or on any V8 Isolates runtimes (eg Cloudflare Workers). | ||
| Works on Node.js `>=18.17.0` (or later) or on any V8 Isolates runtimes (eg Cloudflare Workers). |
There was a problem hiding this comment.
I'd drop this change from the PR (as it's unrelated) and put it into a separate one as this needs fixing in all READMEs
There was a problem hiding this comment.
Nice, thanks!
| }, | ||
| "engines": { | ||
| "node": ">=18.17.0" | ||
| "node": ">=18.18.0" |
There was a problem hiding this comment.
You'll want to drop that change as we need 18.17.0 for Vercel
9c0b2d2 to
de0e430
Compare
LekoArts
left a comment
There was a problem hiding this comment.
Once the typo is fixed, LGTM
|
|
||
| - Added the `User.last_active_at` timestamp field which stores the latest date of session activity, with day precision. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUser). | ||
| - Added the `last_active_at_since` filtering parameter for the Users listing request. The new parameter can be used to retrieve users that have displayed session activity since the given date. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList). | ||
| - Adde the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList). |
There was a problem hiding this comment.
| - Adde the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList). | |
| - Added the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList). |
Small typo
There was a problem hiding this comment.
Thanks for catching this!
- User.last_active_at stores the last date of session activity for the user, with day precision - last_active_at can be used to order users when listing - last_active_at_since can be used to filter users based on their latest activity date
de0e430 to
422e36c
Compare
Description
User.last_active_attimestamp field in the user model, see Backend API docs.last_active_at_sincefiltering parameter when requesting the list of users, see Backend API docs.last_active_atas a valid option for theorderByparameter for the UserList request, see Backend API docs.Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore