Get browser icon
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/avatars/browsers/{code}
Description
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user GET /account/sessions endpoint. Use width, height and quality arguments to change the output settings.
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
Required scopes
Authentication
setProject(). No signed-in user or server API key is required.Supports optional impersonation. Learn more
Path
Browser Code.
Query parameters
Image width. Pass an integer between 0 to 2000. Defaults to 100.
Image height. Pass an integer between 0 to 2000. Defaults to 100.
Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
import { Client, Avatars, Browser } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
const avatars = new Avatars(client);
const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional quality: -1 // optional});
console.log(result);Avatars
Get browser icon
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/avatars/browsers/{code}
Description
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user GET /account/sessions endpoint. Use width, height and quality arguments to change the output settings.
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
Required scopes
Authentication
setProject(). No signed-in user or server API key is required.Supports optional impersonation. Learn more
Path
Browser Code.
Query parameters
Image width. Pass an integer between 0 to 2000. Defaults to 100.
Image height. Pass an integer between 0 to 2000. Defaults to 100.
Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
import { Client, Avatars, Browser } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
const avatars = new Avatars(client);
const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional quality: -1 // optional});
console.log(result);