@current-docs/embed
v0.1.0
Published
Embeddable Current docs surface for Next.js App Router hosts: layout, page, search, and OpenAPI components plus install templates. Published as TypeScript source; consume via transpilePackages.
Readme
@current-docs/embed
Embeddable Current docs surface for Next.js App Router hosts. It re-exports the Fumadocs layout, page, search, and OpenAPI building blocks behind one stable import, plus templates/ with the files the docs-embed skill copies into a host app (route group, search route, OpenAPI proxy).
The package ships as TypeScript source, not compiled JS. The host's Next.js build transpiles it, so transpilePackages: ['@current-docs/embed'] in next.config.ts is required. The fumadocs-* packages are regular dependencies and come with the install; the host only needs next, react, and react-dom (peer deps).
Install
npm install @current-docs/embed fumadocs-mdxInside this monorepo use "@current-docs/embed": "workspace:*"; in an onboarded repo use "@current-docs/embed": "^0.1.0" from npm.
Usage
// next.config.ts: transpilePackages: ['@current-docs/embed'], wrap with createMDX()
// lib/docs-source.ts
import { createOpenAPI, loader } from '@current-docs/embed';
import { docs } from '@/.source/server';
export const source = loader({ baseUrl: '/help', source: docs.toFumadocsSource() });
// app/help/layout.tsx
import { DocsLayout, RootProvider } from '@current-docs/embed';
// wrap children: <RootProvider><DocsLayout tree={source.getPageTree()}>{children}</DocsLayout></RootProvider>The full wiring (layout, catch-all page, search and proxy routes, source config) lives in templates/; the docs-embed skill copies them in and adjusts paths.
