Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Conversation

0x62
Copy link

@0x62 0x62 commented Mar 18, 2024

What kind of change does this PR introduce?

There is already support for a filter=xyz query param for the listUsers endpoint, but it is not exposed on the client. This PR adds support for the filter, which allows users to filter the respond of listUsers by a partial or full email address.

This PR also fixes pagination metadata for page values >9. This was originally proposed in #793, but changes were requested and that PR is now stale so I have implemented those changes here too.

What is the current behavior?

It is not possible to filter users via the SDK.

What is the new behavior?

You can now filter users.

Additional context

supabase/auth#880

@0x62
Copy link
Author

0x62 commented Apr 24, 2024

@kangmingtay any chance you could review this?

I came from supabase/auth#1330 (comment), but discovered there is no way to actually use this endpoint from the SDK

hi @JKFSOM, thanks for taking the time to contribute but i don't think we'll be adding this endpoint in - the GET /admin/users endpoint actually allows you to filter for a user's email address already:

for example:

curl -X GET "http://localhost:9999/admin/users?filter=<user_email_address>" -H "Authorization: Bearer ADMIN_JWT"

@mandarini
Copy link
Contributor

Hi @0x62! Thanks for this PR - we really like it, especially the pagination fix for pages >9! Before we can merge, could you please add:

  1. Minimum filter length validation (at least 3 characters):
if (params?.filter && params.filter.trim().length < 3) {
  throw new AuthApiError('Filter must be at least 3 characters', 400);
}
  1. TypeDoc comment warning about performance on the listUsers method:
/**
 * 
 * @warning The filter parameter is provided for convenience but may have performance implications on large databases.
 * Consider using pagination without filters for projects with many users.
 */

Once you add these safeguards, we'll be happy to merge! Thanks again for your contribution to Supabase! :D :D

@0x62
Copy link
Author

0x62 commented Oct 2, 2025

@mandarini Done!

@mandarini
Copy link
Contributor

Closing, moved here: supabase/supabase-js#1741

@mandarini mandarini closed this Oct 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants