Files
logseq/libs
Charlie a95483655b refactor: plugin libs (#12395)
This pull request refactors the plugin library infrastructure and adds new experimental features for hosted/sidebar renderers. The main changes include:

Purpose: Refactor plugin communication library (Postmate) to support MessageChannel for improved performance, add support for hosted/sidebar renderers in plugins, add new debug APIs, and consolidate helper functions.

Changes:

Added MessageChannel support to Postmate for optimized plugin-host communication with backward compatibility
Introduced hosted renderer and sidebar renderer APIs for plugins to register custom UI components
Added new app APIs: get_current_route, export_debug_log_db, reset_debug_log_db
Refactored helper functions from helpers.ts to common.ts and updated all import paths
Extended block property APIs to include class properties with default values
Added comprehensive documentation for experiments APIs and plugin development
Added E2E test for plugin marketplace installation
Version bump from 0.2.12 to 0.3.1
2026-04-14 14:29:22 +08:00
..
2026-03-23 21:32:28 +08:00
2025-10-21 16:32:12 +08:00
2026-04-14 14:29:22 +08:00
2022-09-01 00:31:49 +08:00
2025-10-21 16:32:12 +08:00
2023-12-13 15:42:21 +08:00
2021-05-08 20:32:20 +08:00
2026-04-14 14:29:22 +08:00
2026-03-23 21:32:28 +08:00
2026-03-23 21:32:28 +08:00

@logseq/libs

🚀 Logseq SDK libraries.

Installation

yarn add @logseq/libs

Usage

Load logseq plugin sdk as global namespace

import "@logseq/libs"

APIs & Samples & References

Community templates

  1. https://github.com/logseq/cljs-plugin-example
  2. https://github.com/YU000jp/logseq-plugin-sample-kit-typescript

Feedback

If you have any feedback or encounter any issues, feel free to join Logseq's discord group. https://discord.gg/KpN4eHY

Generate CLJS SDK wrappers

To regenerate the ClojureScript facade from the JS SDK declarations (keeping the same argument shapes as the JS APIs while auto-converting to/from CLJS data):

yarn run generate:schema              # emits dist/logseq-sdk-schema.json
bb libs:generate-cljs-sdk            # emits logseq/core.cljs and per-proxy files under target/generated-cljs

Non-proxy methods (those defined on ILSPluginUser, e.g. ready, provide-ui) land in logseq.core. Each proxy (IAppProxy, IEditorProxy, ...) is emitted to its own namespace such as logseq.app or logseq.editor, preserving the original JS argument ordering while automatically bean-converting CLJS data.

Pass --out-dir to change the output location or --ns-prefix to pick a different namespace root.