Skip to content

Extension API

Don Jayamanne edited this page Nov 13, 2024 · 1 revision

The Jupyter extension exposes a set of APIs that allows 3rd party extensions to

You can install the npm package @vscode/jupyter-extension to get access to the latest API.

Proposed API

At Visual Studio Code, we take Extension API compatibility seriously. We give our best effort to avoid breaking API changes, and extension authors could expect published extensions to continue to work. However, this puts great limitation on us: once we introduce an API, we cannot easily change it anymore.

Proposed APIs solve the problem for us. Proposed APIs are a set of unstable APIs that are implemented in VS Code but not exposed to the public as stable APIs does. They are subject to change, only available by installing the npm package npm i @vscode-insiders@proposed and cannot be used in published extensions. Nevertheless, extension authors could test these new APIs in local development and provide feedback for VS Code team to iterate on an API. Eventually, proposed APIs find their way into the stable API and becomes available for all extensions.

Proposed API to intercept all HTTP/WebSocket Messages

One of the proposed APIs allows 3rd party extensions to intercept all http/websocket messages sent to the remote servers contributed by the same 3rd party extension. I.e. http/websocket messages sent to other Jupyter servers/kernels cannot be intercepted.

This is useful to allow support for custom authentication, intercepting and modifying request/response messages.

The protocols/format of messages sent over http/websocket to the remote servers are documented here https://jupyter-server.readthedocs.io/en/latest/developers/rest-api.html https://jupyter-server.readthedocs.io/en/latest/developers/websocket-protocols.html

Warning

Given these are contributed by 3rd party packages/applications, changes to these messages/protocols are beyond the control of the Jupyter extension. These are some of the dangers of using Proposed APIs.

Clone this wiki locally