Skip to main content

Prerequisites

  • A Framalab account with at least one project that has approved photos
  • A gallery token — see Authentication

1. Install

2. Initialize the client

Store both values as environment variables — never hardcode them in source.
.env.local
client.ts

3. Fetch photos

fetch-photos.ts

4. Render (vanilla JS)

This example runs entirely in the browser and is for illustration only. In production, never expose FRAMALAB_TOKEN client-side — fetch data server-side (SSR, SSG, or a server route) so the token stays on the server.
index.html
You should see all approved photos from your project rendered in the page.

Next steps

Photo Versions

thumb vs medium vs full — when to use each

getMediaUrl

Custom resize, format, and quality transforms

Error Handling

Handle auth and server errors gracefully