
Hello, This is my utility function for obtaining the users' avatar url.
Is this a safe approach to the problem? I am also unsure about ending the url with &mode=admin
. The issue is, without &mode=admin
, it doesn't load the avatars.
export const getAvatarUrl = (avatarId) => {
if (!avatarId) return null;
const url = `${import.meta.env.VITE_ENDPOINT}/storage/buckets/${import.meta.env.VITE_AVATAR_BUCKET}/files/${avatarId}/view?project=${import.meta.env.VITE_PROJECT}&mode=admin`;
return url;
};

Safe Approach to Bucket

mode admin only works for your console session, it will not work for other people. if you want to share this image with others you need to either allowing from your bucket or file permissions depending on which security model you're using
Recommended threads
- 404 for self-host
docker-compose.yml: x-logging: &x-logging logging: driver: 'json-file' options: max-file: '5' max-size: '10m' services: traefik: ima...
- Is p-limit compatible with Appwrite?
I have a function that makes asynchronous calls to different Appwrite collections. This is how I make the call: ```js await Promise.allSettled([ ...
- Realtime stuck on pending
I'm hosting appwrite on a server where there's already nginx running and you can see how it's config looks for appwrite on attachted screenshot. I'm not getting...
