Hello how do I get the user session if it's not directly from a user?
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new sdk.Databases(client);
const result = await databases.updateDocument(
'<DATABASE_ID>', // databaseId
'<COLLECTION_ID>', // collectionId
'<DOCUMENT_ID>', // documentId
{}, // data (optional)
["read("any")"] // permissions (optional)
);```
A webhook is calling this function not directly from a user
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).
How do you expect Appwrite to know which user?
I just continued testing and noticed the dynamic api keys aren't letting me update the document, which Is why maybe I thought I need to set the session then I tried to use the self generated api keys, they work but not the dynamic, which is strange because I thought they're the same
I set the same scopes as well
I don't know if they're working as intended
Recommended threads
- Functions not executing after usage rese...
Hi team, Last month my project hit 100% usage and functions stopped working (expected). Now the new month has started and usage has reset, requests are going ...
- Relations within the same table
Hello, I'm currently building a sort of dictionary (a literal one) and thus I need words (which is one single table of words in my database) to be able to have ...
- Functions never end and always fail (sta...
Hi ! I'm using Appwrite Cloud Pro and function execution from appwrite website is KO. Deploying starter function template, execution is always Failed and the ...