
Encountering a 401 Unauthorized error when attempting to create users
AI assistant suggested I need to create a "server" type API key instead of the current "standard" prefixed key, but my Appwrite console doesn't show any option to select API key types.
Environment
- Appwrite Cloud (NY server region)
- node-appwrite: v13 (downgraded)
- Frontend framework: NextJs
Troubleshooting Steps Taken
- Downgraded node-appwrite SDK to v13
- Recreated API keys
- Created mock user for testing - works successfully with mock data
- Researched Appwrite Discord
- Verified environment var configuration
Current API Key Configuration
- All available scopes are selected
- Key is properly configured in env variables
Suspected Issues Server region selection - NY server region compatibility issues
Frontend architecture compatibility - Current build approach may not be compatible with recent Appwrite updates
UserActions.ts
try {
if (!users) {
throw new Error("");
}
const newUser = await users.create(
ID.unique(),
user.email,
user.phone,
user.name
);
return parseStringify(newUser);
} catch (error: any) {
if (error...) {
const documents = await users.list([Query.equal("email", [user.email])]);
return documents.users[0];
}
console.error("", error);
throw error;
}```
***RegisterForm.tsx***
```const onSubmit = async (form validation) => {
setIsLoading(true);
try {
const user = {
name: values.name,
email: values.email,
phone: values.phone,
};
const newUser = await createUser(user);
if (newUser) {
router.push(`user endpoint`);
}
} catch (error) {
console.log(error);
}
};```
**Questions**
1. Are there known compatibility issues between FE impl. and specific server regions?
2. Has the API key creation process changed in Appwrite?
Recommended threads
- rror creating Appwrite user: User (role:...
I do not understand, I have tryied everything tryable to make this error go away, I have absolutely no more ideas on how should I correct this. Anything can hel...
- Is it possible to initialize an Appwrite...
If I provide a project repository to someone, and within that repo there is an `appwrite.json`, is it possible to initialize the project in Appwrite from scratc...
- Realtime listener does not get update wh...
listener (flutter) ``` realtime .subscribe(['databases.6882943XXXXX.tables.public.rows.main']) .stream .listen((message) { print(message); });``` ...
