Apps and libraries can both have an asset folder. Use public for files that the browser can request, and private for files that only server code should read.
asset/public/
Served as static assets. Use it for images, PDF files, downloadable JSON, icons, and other files that can be public.
asset/private/
Available only to server-side code. Use it for seed data, private JSON, model files, and resources used by server jobs.
Public Assets
Files under asset/public are copied to the app's public surface and served by the server. The browser can request them directly by URL.
public asset examples
Link to a PDF
Fetch static JSON
Optimized Images
When an image is public, you can render it with the Image component from akanjs/ui. Akan serves an optimized image response in a similar way to Next.js image optimization, so use this for UI images instead of a plain img tag when possible.
HeroImage.tsx
Private Assets
Files under asset/private are for server-only resources. Put files here when the browser should not download them directly, but the server needs them to load data, run inference, or initialize a service.
private asset examples
Load private JSON on the server
Use a private model file on the server
Library Asset Sync
When a library has assets, Akan syncs both public and private assets into each app. Public assets become browser-requestable files, while private assets stay server-only after sync.
library asset mapping
Use synced public library asset
Use synced private library asset
Practical Rules
Use public when the browser is allowed to request the file directly.
Use private when the file contains internal data, model weights, or server-only configuration.
Use Image from akanjs/ui for public UI images that should be optimized by the server.
Put reusable public files in a library asset folder when multiple apps need the same asset.