Advanced blökkli Adapter: Library, Media, AI, and More
Optional adapter methods for advanced blökkli features: reusable library, media library, AI assistant, comments, search, import, and preview grants.
These optional adapter methods unlock blökkli’s advanced features. Implement the ones relevant to your project — blökkli automatically activates the corresponding editor feature when the method is present in your adapter.
All methods described on this page are fully typed. Check the TypeScript types
exported from @blokkli/editor for the exact parameter shapes and return
types, and use them in your adapter for end-to-end type safety.
The library feature lets editors save blocks as reusable items and insert them across multiple pages. All four methods below work together — implement them as a group to enable the full library workflow.
getLibraryItems()
Returns the list of saved reusable block items available to the current user. blökkli calls this when the user opens the Library panel.Signature
Saves an existing block to the library under a user-supplied title. Called when the user selects “Save to library” from the block context menu.Signature
The media library panel lets editors search for existing media assets and insert blocks from them directly.
mediaLibraryGetResults({ searchText, page })
Returns paginated media search results for the media library panel. Called whenever the user types into the search field or navigates to a new page of results.Signature
The AI assistant panel lets editors generate block content from a natural language prompt.
assistantGetResults({ prompt })
Called when the user submits a prompt in the AI assistant panel. Return an array of suggested block definitions that the editor can present as insertion candidates.Signature
The content search panel lets editors find existing content items and insert blocks from them.
getContentSearchTabs()
Returns tab definitions for the content search panel. Each tab represents a separate searchable content source (for example, “Articles”, “Products”).Signature
Builds the URL for the block edit form iframe. When implemented, blökkli renders this URL in an iframe panel when the user opens the edit form for a block — useful for embedding your existing backend edit forms.Signature
The URL returned by getPreviewGrantUrl() is copied to the clipboard when
the user clicks the Share Preview button in the toolbar. Ensure the URL is
publicly accessible and includes a time-limited token to prevent permanent
unauthorised access.