Collaborating on one Binder instance

Normally, if you try to share a link to your active binder, you will get an error like this:

The issue is that you don’t have the authentication token for the session. You can get this token, however, by running the jupyter notebook list command in the terminal. If you are in JupyterLab go to File > New > Terminal. For me, it looks like this:

jovyan@jupyter-jupytercalpoly-2drich-2dcontext-2ddemo-2d76a9qi1l:~$ jupyter notebook list
Currently running servers:
http://0.0.0.0:8888/user/jupytercalpoly-rich-context-demo-76a9qi1l/?token=m8mGhkqcSDWmcpuNqF1Hgw :: /home/jovyan

All we need to do now is copy that URL, but replace the host of http://0.0.0.0 with https://hub.mybinder.org. In this case it would be https://hub.mybinder.org/user/jupytercalpoly-rich-context-demo-76a9qi1l/?token=m8mGhkqcSDWmcpuNqF1Hgw. Now if you are that URL with someone else, they will be able to connect to this same container. That means, if you save a file they will be able to see it.

We are using this for a demo of the new Rich Context work to try out multiple users commenting on a notebook at the same time, backed by a singular GraphQL server.

4 Likes

whoahhh y’all are at the bleeding edge of binder :slight_smile:

1 Like

It’s great to be able to stand on the shoulders of all this work :smiley:

Nice!

The Gesis BinderHub has button in the top right of every binder

that give you the link for sharing your instance/session. We’ve discussed adding all the buttons except for the “copy session link” to mybinder.org (not quite sure why we haven’t done it :-/). Should we re-discuss having that button? I still feel that it would encourage people to share something which is similar to a password and so we shouldn’t … but I know people have been doing this for a while and it allows cool features like the on shown in this thread. Maybe we could make the button one that needs confirming?

Lots of document share systems have a ‘share’ link with semantics of ‘this document will be viewable to people with access to this link’.

The Binder notebook instances are also temporary / ephemeral, so sharing is only for as long as the instance is running and then the toke is null and void anyway.

1 Like

Maybe a JupyterLab extension for binder that copies a sharable link to the clipboard?

Just pop up a dialog with the link and an explanation of how to handle it correctly.

If you wanna just get this token in a oneliner, try:

jupyter notebook list --json | python3 -c 'import json; import sys; print(json.load(sys.stdin)["token"])'

You can then use the URL to your binder server instance (with the random chars), add ?token=<token> and pass it to someone. Then they will share your session, for things like this.

1 Like

oops! I added it in by directly editing yuvi’s post as administrator, I hope that’s OK yuvi!

Just published a JupyterLab extension to make this easier to use and a bit more user friendly:

Which can be installed with pip install jupyterlab-link-share. Or added to the requirements.txt on Binder.

For now it’s only on PyPI and for JupyterLab 3.0, but if folks find it useful we can package it for conda too.

EDIT: now available on conda-forge too

3 Likes