Skip to main content
The Framalab SDK is a zero-dependency TypeScript client for the Gallery API. It gives developers typed access to a project’s approved photos — collections, versions, and on-demand image transforms — so you can build the gallery frontend in any stack you choose.
Looking for the Framalab panel? Go to framalab.dcmxstudio.com. This documentation is for developers building gallery frontends with the SDK.

Get started in four steps

1

Install the SDK

pnpm add @framalab/sdk
2

Get a gallery token

In your Framalab panel, open the project, go to Settings → Gallery, and click Generate token. Copy it immediately — it is shown only once.
3

Initialize the client

Store the token in an environment variable — never hardcode it in your source.
.env.local
GALLERY_TOKEN=your-gallery-token
import { createFramalabClient } from "@framalab/sdk"

const client = createFramalabClient({
  baseUrl: "https://panel.yourdomain.com",
  token: process.env.GALLERY_TOKEN!,
})
4

Fetch your first photos

const photos = await client.getPhotos()
const thumb = photos[0]?.versions.find(v => v.versionType === "webp_thumb")
console.log(thumb?.url)

Explore the docs

Quickstart

Install the SDK, initialize the client, and fetch your first photos in under 5 minutes.

SDK Reference

Full reference for all five SDK methods with types and examples.

Authentication

How gallery tokens work and how to store them safely.

Examples

Full implementations for Next.js App Router and Astro.