Skip to content
Back

Auth Error

  • 0
  • React Native
  • Auth
  • Web
  • Cloud
Popt
11 Jul, 2025, 12:18

const user = await createSessionClient(session).account.get();

node-appwrite package can work but react-native-appwrite package cannot work.

The only different is package, the source code of the createSessionClient function is exactly the same.

In my client, which is the client using react-native-appwrite package, this error is always thrown: [AppwriteException: User (role: guests) missing scope (account)]

I even hardcoded the correct session secret and it didn't work. It threw this error: [AppwriteException: User (role: guests) missing scope (account)] const user = await createSessionClient(hardcode_session_secret).account.get();

createSessionClient function:

`export function createSessionClient(session: string) { const client = new Client() .setSession(session) .setProject(process.env.EXPO_PUBLIC_APPWRITE_PROJECT) .setEndpoint(process.env.EXPO_PUBLIC_APPWRITE_END_POINT);

return { get account() { return new Account(client); },

TypeScript
get storage() {
  return new Storage(client);
},

get databases() {
  return new Databases(client);
},

}; }`

TL;DR
Issue: Using react-native-appwrite package throws [AppwriteException: User (role: guests) missing scope (account)] error, even with correct session secret. Details: The createSessionClient function from the node-appwrite package works, but the react-native-appwrite equivalent results in the error. Solution: The error is due to missing scopes. Ensure the user role has access to the 'account' scope.
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