React Developer
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": true, "labels": ["admin"], "mfa": false, "name": "quan", "passwordUpdate": "2025-03-18T07:10:17.839+00:00", "phone": "", "phoneVerification": false, "prefs": {}, "registration": "2025-03-18T07:10:17.839+00:00", "status": true, "targets": [{"$createdAt": "2025-03-18T07:10:17.896+00:00", "$id": "[redacted]5ebed2", "$updatedAt": "2025-03-18T07:10:17.896+00:00", "expired": false, "identifier": "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