Subscribing to the Notebook "save" event on the JupyterLab server extension

I’m trying to do some work on the server side of the JupyterLab extension after the Notebook has been saved by the user (or automatically). I’m trying my best to avoid doubling the number of requests to the server, since the application is kinda high-traffic already, and it’s gonna get worse.

I tried digging through various JupyterLab ecosystem repos, but I wasn’t able to find which Handler to override to get what I want, and I wasn’t able to find that scenario documented.

So, if anyone has any idea on how to subscribe to the “save” events on the back-end side, or has some kind of relevant example, it would be super helpful.

1 Like

how to subscribe to the “save” events on the back-end side

Did you see/try jupyter-server file save hooks?

https://jupyter-server.readthedocs.io/en/latest/developers/savehooks.html

3 Likes

Nope, did not see this before. Seems like something I could use, thank you a lot!

Wish it was closer to the JupyterLab extension code, but I guess I’ll manage.

UPDATE: It works :slight_smile:

1 Like