---
title: "User Avatars"
description: "Custom profile avatars uploaded from the FNLB app."
canonical: "https://developers.fnlb.net/docs/cdn/user-avatars"
markdown: "/docs/cdn/user-avatars.md"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://developers.fnlb.net/llms.txt
> Use this file to discover all available pages before exploring further.

# User Avatars

User avatars are the profile images shown on account screens and community listings. The app stores them on the CDN and exposes one immutable URL per upload, which you can hotlink directly.

## The URL

```text
https://cdn.fnlb.net/user-avatars/{userId}/{avatarId}.webp
```

`{userId}` is the FNLB account id and `{avatarId}` is the value in the user's `avatar` field. When `avatar` is empty, the user has no custom avatar and the URL does not exist.

## Uploading an avatar

Avatars are uploaded from the Account screen in the FNLB app when the `userAvatar` feature flag is enabled. The app accepts PNG and JPEG files between 1 KB and 10 MB, with a maximum source size of 2048×2048, applies the image's EXIF orientation, then:

- Center-crops the image to a square.
- Resizes it to at most 256×256 without enlarging smaller images.
- Encodes it as WebP at quality 80.

The result is written back to the CDN under a new `avatarId`, and the user's previous avatars are removed.

## Immutability and caching

Every upload produces a new `avatarId`, so the URL changes whenever the avatar changes. Treat user avatar URLs as immutable and cache them for as long as you like, with no `?v=` query needed.

## Example

```ts
const avatarUrl = avatarId
  ? `https://cdn.fnlb.net/user-avatars/${userId}/${avatarId}.webp`
  : undefined;
```

## Next

<CardGroup cols={2}>
  <Card icon="code" href="/docs/cdn/app-icons" title="App icons">
    Uploaded icons for applications in the portal.
  </Card>
  <Card icon="http" href="/docs/cdn/overview" title="CDN overview">
    What the CDN serves and how to cache it.
  </Card>
</CardGroup>
