UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

33 lines (32 loc) 982 B
import { Toolkit, ToolkitContext } from "./types.mjs"; //#region src/libs/toolkit/create-toolkit.d.ts /** * Creates a server-side toolkit for reading Lucid data. * * Use this in server code when you want a small, read-focused API for Lucid * content, locales, media, and external email sends. * * For client-side data fetching, use the Lucid SDK instead. * * When Lucid needs to build absolute URLs, it uses `config.host`, then * `request.url`, and finally falls back to the local Lucid URL. * * Each toolkit method returns Lucid's standard `{ error, data }` response shape. * * @example * ```ts * const toolkit = createToolkit(serviceContext); * * await toolkit.documents.getMultiple({ * collectionKey: "page", * version: "published", * query: { * perPage: 20, * }, * }); * ``` */ declare const createToolkit: (context: ToolkitContext) => Toolkit; //#endregion export { createToolkit as default }; //# sourceMappingURL=create-toolkit.d.mts.map