Skip to content

fumadocs-epub@1.2.1

Choose a tag to compare

@github-actions github-actions released this 10 Sep 15:18
· 4 commits to dev since this release
24e2072

createEpubExportAPI()

A route handler for the EPUB export, replacing the auth check and response headers you had to write yourself:

// app/export/epub/route.ts
import { createEpubExportAPI } from 'fumadocs-epub';
import { source } from '@/lib/source';

export const { GET } = createEpubExportAPI({
  source,
  title: 'Documentation',
  author: 'Your Team',
  secret: process.env.EXPORT_SECRET,
});

secret is required: requests must send Authorization: Bearer <secret>, and the route answers 503 while the secret itself is unset, so a missing environment variable cannot leave the export open. It also takes filename (default docs.epub) and every option of exportEpub(), which stays available for public routes and scripts.