I have a function that inserts a document to a collection, but I also need to get the user id of the one who invoked the function. I use client side SDK for executing the function.
I tried the following:
`const { Client, Databases, Account } = require('node-appwrite');
const appwriteClient = new Client(); const databases = new Databases(appwriteClient); const account = new Account(appwriteClient);`
but the account variable produces an error.
(role: applications) missing scope (account)
nvm, i just found out about the req.headers x-appwrite-user-id
[SOLVED] How to get user id from the executed function?
Recommended threads
- Cloud function deployment failures
When I run appwrite push functions, select the function I want to deploy, confirm with a YES, is starts deploying but goes into error. I need to repeat the ste...
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...