React embed: jump to existing bookmark (Bookmark.GoTo()) — plugin loads but host command doesn’t trigger

Hi, I’m embedding ONLYOFFICE Docs Community via DocsAPI (new DocsAPI.DocEditor(…)) in a React app (backend NestJS for create-session + callback; saving works).

We inject bookmarks into DOCX on backend (names like c_). Downloading the doc and using MS Word “Go To Bookmark” works, so bookmarks are definitely present.

Goal: click a citation in React → jump to that bookmark in ONLYOFFICE using:

Api.GetDocument().GetBookmark(name).GoTo() (plugin/callCommand context).

What we tried:

  • Connector API (createConnector/callCommand/executeMethod) → not available/reliable (and docs indicate Developer/Automation).

  • Custom plugin hosted on Cloudflare Pages (config/index/code load 200; plugin appears in Plugins list and autostarts).

  • From React we tried to send commands to plugin:

    • docEditor.serviceCommand(“goToBookmark”, { bookmark })

    • docEditor.serviceCommand(“internalcommand”, { command:“goToBookmark”, data:{bookmark} })

    • docEditor.serviceCommand(“onExternalPluginMessage”, { type:“goToBookmark”, bookmark })

No errors, but nothing happens (no jump). Plugin code can run callCommand fine, but it never receives the message.

Question: What is the official supported way (DocsAPI embed, Community) to trigger a plugin action from the host page at runtime? Any minimal example of host→plugin message wiring for “go to bookmark”?

Thanks.

Hello @daniyal.mujtaba

Regular plugins do not have access to the outside of the frame with the editor. Basically, plugins can be only used in their own context inside the editor iframe.

To access Office API from outside the frame you should use Automation API: Automation API | ONLYOFFICE

Other than that, I can only suggest developing a side panel plugin with the same functionality to be accessible from inside the editor frame.

Thanks for replying. Yeah I figured that part out once I spoke to the Sales team for a trial on Developer Edition. I was trying to vibe code so missed that important piece of information from the docs.

1 Like