
Hello, I am building an auth function and while I could create an account, users were not stored in the collection. I double-checked that databaseId and userCollectionId were correct. What could be a potential issue?
TypeScript
export async function createUser(email, password, username) {
try {
const newAccount = account.create(ID.unique(), email, password, username);
if (!newAccount) throw Error;
const avatarUrl = avatars.getInitials(username);
await signIn(email, password);
const newUser = await databases.createDocument(
config.databaseId,
config.userCollectionId,
ID.unique(),
{
accountId: newAccount.$id,
email,
username,
avatar: avatarUrl,
}
);
return newUser;
} catch (error) {
throw new Error(error);
}
}
TL;DR
Developers are having an issue where newly created user accounts are not being saved to the collection. While double-checking database IDs and collection IDs, the issue persists. The potential problem might be because the `newAccount` variable is not being properly created. Make sure the account is successfully created before proceeding to save the user to the collection.
What's the response?

I see this
Recommended threads
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
- Create platform and can not connect ping
I created a new platform but when I cloned the source, I didn't see the lib/... folder, only env. Then I created a .env file and added those files, then pinged ...
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
