BIO.RE
Themes

List Theme Presets

Public list of PUBLISHED theme presets for the creator bio editor / client-web theming. Sanitized output — only id/name/slug + light/dark/typography tokens.

GET /api/v1/themes — 🌐 Public

Returns the published theme presets for client-web theming — typically used to render a theme picker in the creator's bio editor. PUBLISHED-only filter; DRAFT / ARCHIVED never leak. Internal metadata (status, isActive, tokenSchema, layout, assets, description, thumbnail, createdBy, publishedBy, activatedBy, all timestamps) is stripped from the response.

Sanitized list shape. This endpoint returns ONLY { id, name, slug, lightTokens, darkTokens, typography } per preset. To get the active preset for live application (which includes layout + assets), use GET /themes/active. The list is for picker UI only — render a thumbnail-style card from name + slug and let the user click to apply.

Request

Query parameters

ParamTypeDefaultNotes
targetstringCLIENTAlways omit — server defaults to CLIENT (the only target relevant to client-web / creator bio editor).

No headers required.

Response

200 OKApiResponseOf<PublicThemeListResponseDto>

{
  "success": true,
  "data": {
    "themes": [
      {
        "id": "tp1a2b3c4-d5e6-7890-abcd-ef1234567890",
        "name": "Default Light",
        "slug": "default-light",
        "lightTokens": { "color": { "bg": "#FFFFFF", "fg": "#0F172A" } },
        "darkTokens": { "color": { "bg": "#0F172A", "fg": "#FFFFFF" } },
        "typography": { "fontFamily": "Inter, sans-serif" }
      }
    ]
  }
}

Item fields

FieldTypeNotes
idstring (UUID)ThemePreset.id
namestringDisplay name
slugstringURL-friendly identifier
lightTokensobjectJSON design-token tree (light mode)
darkTokensobjectJSON design-token tree (dark mode)
typographyobjectJSON typography settings (fonts, scales)

Stripped fields

status (always PUBLISHED here, filter excludes), isActive, tokenSchema, layout, assets, description, thumbnail, createdBy, publishedBy, activatedBy, publishedAt, activatedAt, createdAt, updatedAt — all internal-only, excluded.

Errors

This endpoint has no documented error responses beyond infrastructure failures.

Side effects

  1. prisma.themePreset.findMany({ where: { target: 'CLIENT', status: 'PUBLISHED' }, orderBy: createdAt desc, take: 500 }).
  2. Map each row to the sanitized 6-field projection. No mutations.

Code samples

curl https://api.bio.re/api/v1/themes
type PublicThemePreset = {
  id: string;
  name: string;
  slug: string;
  lightTokens: object;
  darkTokens: object;
  typography: object;
};

async function listThemes(): Promise<PublicThemePreset[]> {
  const res = await fetch('https://api.bio.re/api/v1/themes');
  const json = await res.json();
  if (!res.ok || !json.success) {
    throw Object.assign(new Error(json?.error?.message ?? 'Themes fetch failed'), {
      code: json?.error?.code,
    });
  }
  return json.data.themes;
}
import { useQuery } from '@tanstack/react-query';

export const themeKeys = {
  list: () => ['themes', 'list'] as const,
};

export function useThemeList() {
  return useQuery({
    queryKey: themeKeys.list(),
    queryFn: async () => {
      const res = await fetch('/api/v1/themes');
      const json = await res.json();
      if (!res.ok || !json.success) {
        throw Object.assign(new Error(json?.error?.message ?? 'Themes fetch failed'), {
          code: json?.error?.code,
          i18nKey: json?.error?.i18nKey,
        });
      }
      return json.data.themes as PublicThemePreset[];
    },
    // Catalog rarely changes within a session
    staleTime: 5 * 60_000,
  });
}

Try it

GET
/api/v1/themes

Query Parameters

target?string

Theme target (CLIENT or ADMIN)

Value in"CLIENT" | "ADMIN"

Response Body

application/json

curl -X GET "https://loading/api/v1/themes"
{
  "success": true,
  "data": {
    "themes": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "Default Light",
        "slug": "default-light",
        "lightTokens": {},
        "darkTokens": {},
        "typography": {}
      }
    ]
  }
}

Source

SourcePathLines
Controllerapps/api-core/src/modules/theme-preset/theme-preset-public.controller.ts21–38 (listPublished)
DTO (response)apps/api-core/src/modules/theme-preset/dto/theme-preset-response.dto.ts116–119 (PublicThemeListResponseDto), 91–109 (PublicThemePresetDto)
Serviceapps/api-core/src/modules/theme-preset/theme-preset.service.ts119–129 (findAll(target, status))
Prisma modelpackages/prisma/prisma/schema.prismaThemePreset (filter target = CLIENT + status = PUBLISHED)

On this page