-
Couldn't load subscription status.
- Fork 402
feat: Introduce user latest session activity date and allow ordering & filtering when listing users #2261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR for this is up: #2264
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
packages/backend/package.json
Outdated
| }, | ||
| "engines": { | ||
| "node": ">=18.17.0" | ||
| "node": ">=18.18.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to drop that change as we need 18.17.0 for Vercel
9c0b2d2 to
de0e430
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the typo is fixed, LGTM
.changeset/funny-lamps-work.md
Outdated
|
|
||
| - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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