Back

Firebase OnAuthChanged like functionality in Appwrite

  • 1
  • Users
  • Accounts
  • Web
  • Cloud
K_Vasen
21 Dec, 2023, 11:44

I am using svelte with appwrite to get the user. I wrote a svelte store to subscribe to realtime connection with following events. user.${userId}.session.*. Does it equivalent to firebase OnAuthChanged hook.? I want userStore to be updated whenever the realtime channel with given event is fired.

TL;DR
The user wants to know if there's a functionality similar to Firebase's onAuthChanged in Appwrite. They mention using the Appwrite SDK, and currently call `account.get()` and store the result on app start and clear the user state on logout. They are using Svelte and have written a Svelte store to subscribe to a realtime connection with specific events, but want to know if it is equivalent to Firebase's onAuthChanged.
Drake
21 Dec, 2023, 17:05

The Appwrite SDK works differently than the firebase SDK so it does not have an onAuthChanged hook.

Drake
21 Dec, 2023, 17:06

usually, it's not needed. I call account.get() and store the result on app start and then i clear the user state on logout.

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