
after reading what i could find on sessions (https://appwrite.io/docs/references/cloud/models/session) and account (https://appwrite.io/docs/references/cloud/client-react-native/accountI), i seem to understand that:
- $id is the session id
- the userId is the user id... however, when i run account.get() i seem to get the session id for both of those. there are no id's that match in my database atleast,
i have it setup like this:
client
.setEndpoint(config.endpoint)
.setProject(config.projectId)
.setPlatform(config.platform);
const account = new Account(client);
export async function getCurrentUser() {
try {
const user = await account.get();
console.log('Current user fetched:', user);
return user;
} catch (error) {
console.log('No active session:', error);
return null;
}
}
this returns something like this:
Current user: {"$createdAt": "2025-03-18T07:10:17.842+00:00", "$id": "[redacted]dc362c", "$updatedAt": "2025
-03-19T07:14:11.225+00:00", "accessedAt": "2025-03-19T07:14:11.220+00:00", "email": "quan@example.com", "emailVerification": tr
ue, "labels": ["admin"], "mfa": false, "name": "quan", "passwordUpdate": "2025-03-18T07:10:17.839+00:00", "phone": "", "phoneVe
rification": false, "prefs": {}, "registration": "2025-03-18T07:10:17.839+00:00", "status": true, "targets": [{"$createdAt": "202
5-03-18T07:10:17.896+00:00", "$id": "[redacted]5ebed2", "$updatedAt": "2025-03-18T07:10:17.896+00:00", "expired": false, "ide
ntifier": "junker@example.com", "name": "", "providerId": null, "providerType": "email", "userId": "[redacted]dc362c"}]}
the user id that i can see in the database (or collection) is "[redacted]2eefbb"
am i understanding the documentation wrong? am i reading the returned data wrong perhaps? i dont quite understand what is at work here, as it seem other users on the internet are just getting their id'd like they want.
any help is appreciated

it seems like i have indeed misunderstood. what is happening is that i am getting the user id from a schema or document, which is the same user as the one in auth. however, the id's arent the same, and i am ofcourse checking up on the auth id, against the other id, which would never be the same
Recommended threads
- How we can scale on the redis side ?
On my instance, i have really tons of request made each second (see pictures, the blue is because my boss want enterprise color everywhere...) My problem is th...
- Error 400 general_bad_request
I am getting `general_bad_request` when trying to login Github I have follow the `Appwrite's YouTube video to setup Github OAuth` ```javascript const loginWith...
- Is Appwrite Cloud ready for production b...
I create really simple expo app just to get listing todos data from appwrite, its 100% fine when i build it in development profile, but when i try to build usin...
