Endpoint Lasso is a public Supernote plugin framework for sending the current lasso selection, or highlighted DOC text, to your own HTTP endpoint.
It is intentionally generic. Instead of baking in one personal backend, it gives you a reusable transport layer that you can point at your own service for OCR, indexing, search, note capture, flashcard generation, or custom LLM pipelines.
- works from the lasso toolbar in
NOTEandDOC - also adds a DOC text-selection toolbar button for highlighted text
- sends structured metadata for the current file, page, lasso rectangle, and selected elements
- can optionally attach a generated full-page
NOTEPNG - supports either
multipartorjsonrequest formats - is configured from environment variables before build, so no source edits are required for normal setup
- Copy
.env.exampleto.env. - Set
SN_ENDPOINT_URL. - Optionally set auth headers, timeout, button label, PNG behavior, and request format.
- Install dependencies:
npm install- Build the plugin:
npm run build:pluginThe packaged plugin is written to:
build/outputs/supernote-endpoint-lasso.snplg
The build step reads .env plus the current shell environment and generates src/runtimeConfig.js.
Required:
SN_ENDPOINT_URL: destination endpoint URL
Common optional variables:
SN_REQUEST_FORMAT:multipartorjson(default:multipart)SN_AUTH_HEADER_NAME: auth header name, for exampleAuthorizationSN_AUTH_HEADER_VALUE: auth header value, for exampleBearer ...SN_EXTRA_HEADERS_JSON: JSON object of extra headersSN_BUTTON_NAME: toolbar label (default:Send Lasso)SN_DOC_SELECTION_BUTTON_NAME: DOC text-selection label (default:Send Selection)SN_TIMEOUT_MS: request timeout in milliseconds (default:20000)SN_INCLUDE_PAGE_PNG:trueorfalse(default:true)SN_EXPORT_DIR: device path for temporary PNG exportSN_PNG_SCALE: PNG scale factor (default:1)SN_PNG_BACKGROUND_TYPE:0transparent or1white (default:1)SN_PAYLOAD_FIELD_NAME: multipart field name for the JSON payload (default:payload)SN_IMAGE_FIELD_NAME: multipart field name for the page PNG (default:page_png)SN_SUCCESS_DIALOG_TITLE: success dialog title shown on-device
For lasso selections, Endpoint Lasso builds a payload shaped like this:
{
"framework": {
"name": "Endpoint Lasso",
"version": "0.1.3"
},
"generated_at": "2026-04-14T00:00:00.000Z",
"source": {
"file_path": "...",
"file_kind": "note",
"page_num": 3,
"page_size": {"width": 1404, "height": 1872},
"lasso_rect": {"left": 100, "top": 200, "right": 600, "bottom": 900}
},
"elements": [
{
"type": 0,
"uuid": "...",
"page_num": 3,
"layer_num": 1,
"recognize_result": null,
"text": null,
"text_rect": null,
"contours": [[{"x": 1, "y": 2}]]
}
],
"attachments": {
"page_png_included": true,
"page_png_mode": "note-export"
}
}If SN_REQUEST_FORMAT=multipart, the payload is sent as a JSON field plus an optional PNG file field.
If SN_REQUEST_FORMAT=json, the payload is sent as JSON only.
For highlighted DOC text, the payload uses the same transport but sets
source.selection_kind to doc_text and includes both a structured selection
object and a convenience top-level selected_text field:
{
"framework": {
"name": "Endpoint Lasso",
"version": "0.1.3"
},
"generated_at": "2026-04-22T00:00:00.000Z",
"source": {
"file_path": "...",
"file_kind": "document",
"page_num": 3,
"page_size": null,
"selection_kind": "doc_text",
"selection_api": "PluginDocAPI.getLastSelectedText"
},
"selection": {
"kind": "doc_text",
"text": "highlighted text from the document"
},
"selected_text": "highlighted text from the document",
"elements": [],
"attachments": {
"page_png_included": false,
"page_png_mode": "not-supported-for-doc-selection"
}
}NOTEandDOClasso metadata are both supported.- DOC highlighted text is read with
PluginDocAPI.getLastSelectedText, falling back togetSelectedTexton older SDKs. - Full-page PNG export is only attempted for
NOTEfiles. - The toolbar action is headless (
showType=0) and uses native dialogs for success/failure feedback. .envand generated runtime config are intentionally ignored by git.
- OCR pipelines
- document or note clipping
- search and indexing
- personal knowledge system ingestion
- Anki or flashcard generation
- self-hosted or remote LLM workflows
MIT