Back

Sessions was created using MagicURL method

  • 0
  • Self Hosted
  • Web
  • Users
ymihn1
2 Jun, 2023, 18:05

I'm using Server SDK to fetch a list of sessions for a user and got the response as follows: { response: { total: 6, sessions: [ [Object], [Object], [Object], [Object], [Object], [Object] ] } }

TL;DR
The user is using the Server SDK to fetch a list of sessions for a user. They are experiencing an issue where the nested data is not consistently available. They suggest trying to stringify the response. The user includes their code and provides an example of the response they are getting. There is no solution provided in the thread.
Drake
2 Jun, 2023, 18:06

Where exactly are you seeing this?

ymihn1
2 Jun, 2023, 18:07

Here is my code ```import sdk from "node-appwrite"

if (!process.env.APPWRITE_API_KEY) throw new Error("Provide Appwrite API KEY in local env") // Init SDK const client = new sdk.Client();

client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject(process.env.PROJECT_ID) // Your project ID .setKey(process.env.APPWRITE_API_KEY) // Your secret API key ;

const users = new sdk.Users(client); console.log({users}) const promise = users.listSessions('6479f90459eb835c464e');

promise.then(function (response) { console.log({response}); }, function (error) { console.log({error}); }); ```

ymihn1
2 Jun, 2023, 18:08

the console.log({response}) return this

Drake
2 Jun, 2023, 18:09

Maybe it's not recursively expanding. Ive noticed sometimes the browser logs lazy loads some nested data and after a while the nested data is no longer available

You can stringify it if you want

ymihn1
2 Jun, 2023, 18:17

That's good to know thank you!

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