Back

[Solved] How can i get user id in function

  • 0
  • Functions
Hemish11
7 Jul, 2023, 17:58

I want to get user id that invoked the function, so how can i get the same?

TL;DR
The user wants to know how to get the user id in a function. The solution is to use the `APPWRITE_FUNCTION_USER_ID` variable.
Binyamin
7 Jul, 2023, 18:00

You'll have it inside the APPWRITE_FUNCTION_USER_ID variable.

TypeScript
const userId = res.variables['APPWRITE_FUNCTION_USER_ID']
Hemish11
7 Jul, 2023, 18:02

Thanks a lot

Hemish11
7 Jul, 2023, 18:02

[Solved] How can i get user id in function

whataboutno13
18 Sep, 2023, 15:54

Hey @Binyamin, I am working on an Appwrite App in the apwrite cloud and wanted to lookup this information in the docs but it seems like the docs only describe the newest for version 1.4. Is there a plan to provide documentation for older appwrite versions?

Binyamin
18 Sep, 2023, 15:57

In the API docs you can select version Otherwise you'll need to search for it in GitHub

whataboutno13
18 Sep, 2023, 16:11

Yes in the reference part, but not in the Guides section...

whataboutno13
18 Sep, 2023, 16:20

Alright, thanks 👍

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