So I create jwt on the frontend for the user:
const promise = account.createJWT();
How do I retrieve it on the backend?
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('[PROJECT_ID]') // Your project ID
.setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token
from client send it to server
is JWT attached to every req?
No
If a user is execution the function then any time is doing so a fresh JWT will be sent to you inside the APPWRITE_FUNCTION_JWT variable.
Like so
.setJWT(req.variables.APPWRITE_FUNCTION_JWT ?? '')
Check here for more details: https://appwrite.io/docs/functions#functionVariables
Recommended threads
- How to use dart workspaces to deploy a f...
Hello, I'm developing a Flutter application and I would like to leverage dart pub workspaces to deploy a function with a dart runtime as advertised here : http...
- Migration from Cloud to Self-Hosted not ...
Hello Appwrite Community, I've got the problem, that when I try to migrate my Appwrite Project from the cloud to my self-hosted Appwrite, that an API Key is mi...
- I can't migrate my project from Appwrite...
I'm having an issue migrating my Appwrite project to a self-hosted instance. The problem is that I've exceeded my read rate limit (or database read limit), so I...