Back

[SOLVED] Am I obligated to set a phone number when creating a user from node-appwrite?

  • 0
  • Web
leonardorick
20 Oct, 2023, 17:13

The sintax puts the phone number before the password

TypeScript
return await users.create(ID.unique(), email, 'phone', password);

Is there a way to create a user only with email and password?

TL;DR
The user wants to know if they are obligated to set a phone number when creating a user from node-appwrite. The solution is to set the `phone` parameter to `undefined` when creating a user. The user can create a user only with the email and password by using the `create` method with the appropriate parameters.
kathelia.dokgu
20 Oct, 2023, 17:43

Only the userId is required. You can set phone to undefined. https://appwrite.io/docs/references/cloud/server-nodejs/users#create

VincentGe
20 Oct, 2023, 18:47

use undefined

leonardorick
20 Oct, 2023, 20:46

oh ok, thanks. I really think password should come before though 🤔

kathelia.dokgu
20 Oct, 2023, 20:57

I recently opened a new issue to address the parameter order gymnastics that is happening with the SDKs: https://github.com/appwrite/sdk-generator/issues/728

Hopefully it is received well and worked on.

leonardorick
20 Oct, 2023, 21:02

[SOLVED] Am I obligated to set a phone number when creating a user from node-appwrite?

VincentGe
20 Oct, 2023, 21:08

We've thought about this and even did a survey

VincentGe
20 Oct, 2023, 21:08

By far most popular was using object literals

VincentGe
20 Oct, 2023, 21:09

We definitely think it's a step in the right direction 🙂

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more