Hey, do you guys think of having a recipe to query...
# support-questions-legacy
r
Hey, do you guys think of having a recipe to query core to get info about all the users (identities) via one unified API? E.g. something like
SuperTokensClient.getByUserId()
SuperTokensClient.getByEmail()
You can then pass some sort of generic into it (e.g. list of receipts (as a string) that your ST instance uses) to figure out what are possible return types from these functions. I don't know. Returning
unknown
and giving the user a bunch of type guard util functions sounds good to me as well (much easier than complex generic types that are hard to do if you're not an absolute TS pro) Maybe it feels a bit weird, but basically, the idea is to get info from
passwordless_users
thirdparty_users
and
all_auth_recipe_users
and other tables via the list of convenient functions. Also, some e2e testing utils would be nice to have too, so one can create simple users that don't require third-party. E.g.
SuperTokensClient.createEmailPasswordUser(email, password)
and
Passwordless.createPasswordlessUser(email)
just so it's easy to write e2e stuff. Surely in the e2e scenario, I can just open a connection to the Postgres instance that runs locally and do some stuff manually there, but I would prefer ST core to do it right. If you guys already have something like that or you guys have some hints will be glad to hear that.
r
hey @rip21 this is coming in our next big release (which has account linking). You will have functions like: - supertokens.getUserById(userId) - supertokens.listUsersByAccountInfo({ email: ..., })
it should be out in a few weeks, within this month
r
Nice! Thanks for the info. I want that mostly for e2e testing, but some other things, also.