Skip to content
Back

Auth Error

  • 0
  • Web
  • React Native
  • Auth
  • Cloud
Popt
11 Jul, 2025, 02:39

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
Developers are encountering an Auth Error with react-native-appwrite package, while node-appwrite package is working fine. Even after hardcoding the correct session secret, the error persists. The issue seems to be related to missing scope (account). The source code of the createSessionClient function is the same for both packages.
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