DocsGo a little deeperAPI reference
Quick install
Every prop, in one place

API reference

Every prop on EditorProvider and ConfigurableEditorWithAuth, with the types you can rely on.

Last updated

EditorProvider

Provides context and configuration for the editor. Wrap EditorProvider around the editor component to enable all features.

PropTypeDescription
childrenReactNodeThe wrapped content.
defaultFontFamiliesstring[]Override the default font list.
currentUserCurrentUserUser info for comments.
apiKeystringAPI key for read-only mode.

ConfigurableEditorWithAuth

The core editor component with built-in subscription verification and AI service integration.

PropTypeRequiredDescription
apiKeystringRequiredYour Eddyter license key. Authenticates the editor against the server and unlocks tier-based features.
initialContentstringOptionalInitial HTML loaded into the editor on first render.
onChange(html: string) => voidOptionalCalled ~300 ms after content changes (debounced). Receives the current HTML.
onAuthSuccess() => voidOptionalFires once the API key is verified and the editor is ready.
onAuthError(error: string) => voidOptionalFires when API key verification fails. Receives the error message.
customVerifyKey(apiKey: string) => Promise<ApiResponse>OptionalProvide your own verifier (e.g. proxy through your backend) instead of the default endpoint.
mode"edit" | "preview"OptionalRender the full editor ("edit", default) or a read-only preview with link previews ("preview").
containerClassNamestringOptionalClass applied to the outer wrapper container.
contentClassNamestringOptionalClass applied specifically to the editor's writable content area.
onPreviewClick() => voidOptionalFires when the user clicks inside preview mode — typically used to switch to edit mode.
darkModeboolean | undefinedOptionaltrue forces dark, false forces light, undefined (default) auto-detects from the host app's <html>/<body> dark class.
toolbar{ mode?: "sticky" | "static"; offset?: number; zIndex?: number }OptionalToolbar behaviour config. Defaults to { mode: "sticky", offset: 20, zIndex: 1000 }.
editor{ maxHeight?: string | number }OptionalContainer options. maxHeight only applies when toolbar.mode = "static" — caps the editable area's height.
defaultFontFamiliesstring[]OptionalOverride the font picker list. Defaults to the 24 fonts in defaultEditorConfig.defaultFontFamilies.
uiFontFamilystringOptionalFont for the editor's UI chrome — toolbar labels, menus, dialogs, sidebars — so it matches your app's typography. Does not change document content (that's the font picker). Google Fonts families are fetched automatically; a font your page already loads is used as-is. Defaults to Geist.
contentFontFamilystringOptionalStarting font for the document text, shown as selected in the font picker. A default, not a lock — the user can pick another font and their choice wins. Applies to newly typed text; existing content without its own font stays on DM Sans. Not to be confused with defaultFontFamilies, which is the list of fonts offered.
mentionUserListstring[]OptionalUsernames available to the @mentions autocomplete.
classNamestringOptionalClass on the outer wrapper element.
fitToPagebooleanOptionalFull-page layout. The toolbar sticks to the top of the window, the content is centred like a document page, and the word count floats in the bottom corner. Use this layout when the editor is the main content on the page. If used in a modal, the modal must contain only the editor, with no additional content. Defaults to false.
uiStyle"default" | "compact"OptionalVisual style of the editor. Omit it for the default style. Set "compact" to render the toolbar and content as one framed card; layout and behavior are unchanged.
documentIdstringOptionalStable id that scopes version history to this document — pass your record's primary key and reuse it on reopen so history reconnects. If omitted, a best-effort id is derived from the URL (warns; breaks if the URL changes).
refReact.Ref<EddyterEditorHandle>OptionalImperative handle for version history. Call ref.current.saveVersion({ label?, documentId? }) from your Save button to snapshot a version (server-backed, plan-gated). Call it while the editor is still mounted — it no-ops after unmount.
Was this page useful?