-
Notifications
You must be signed in to change notification settings - Fork 422
Description
- Review the documentation: https://docs.clerk.dev/
- Go through package changelog files.
Hi All,
The context
We have a special case where all our users must be invited to use our app, and we don't want the invitee to go through clerk signup process. In fact, we only use clerk for sign-in through our custom components.
So, to allow them to sign in, we need to add our users in clerk DB only when they accept our invitation, programmatically through our backend (nodejs).
The question
What is the role of and how to use externalId?
We could add it through api:
createUser({
externalId: '...',
emailAddress:['[email protected]']
})i.e.:
type CreateUserParams = {
externalId?: string;
emailAddress?: string[];
phoneNumber?: string[];
username?: string;
password?: string;
firstName?: string;
lastName?: string;
skipPasswordChecks?: boolean;
skipPasswordRequirement?: boolean;
} & UserMetadataParams;But we could not query with it:
getUser(userId:string)returns a 404 asuserIdis notexternalId- and
getUserList(params: UserListParams = {})orgetCount(params: UserListParams = {})are usingUserCountParamswhich does not contain it.
i.e.:
type UserCountParams = {
emailAddress?: string[];
phoneNumber?: string[];
username?: string[];
web3Wallet?: string[];
query?: string;
userId?: string[];
};
type UserListParams = UserCountParams & {
limit?: number;
offset?: number;
orderBy?: 'created_at' | 'updated_at' | '+created_at' | '+updated_at' | '-created_at' | '-updated_at';
};So how to use externalId?
If we add it in UserMetadataParams, same thing: how to query it through metadata as metadata are not allowed in UserCountParams
By the way: externalId is not shown in clerk dashboard (user section). I think it should be good to show it there.
Thanks for answering. ;)