How sharing works
Clicking Share triggers a POST request to/api/share with your current editor code as the body. The server stores the code and returns a snippet ID. The playground then:
- Updates the browser address bar to
/p/<snippet-id>using the History API (no page reload) - Sets the full URL as the shared URL state
- Automatically copies the URL to your clipboard
- Replaces the Examples dropdown with a read-only URL input field
1
Write your circuit
Enter or load the OpenQASM code you want to share in the editor.
2
Click Share
Click the Share button in the editor toolbar. The button shows a spinner while the request is in progress.
3
Copy the URL
The shared URL is automatically copied to your clipboard. The toolbar also shows the URL in a read-only input field so you can see and copy it manually.
4
Send the link
Paste the URL anywhere — the recipient opens it and your circuit is pre-loaded in their editor.
The SharedURL input
After a successful share, the Examples dropdown is replaced by a read-only text input showing the full snippet URL. The input auto-focuses and auto-selects its contents so you can copy it with a keyboard shortcut immediately. Clicking the input at any time re-selects the full URL text.The Examples menu is hidden while the SharedURL input is displayed. To load a new example after sharing, reload the page.
Opening a shared URL
When someone opens a/p/:id URL, the playground loads the snippet code from the server and populates the editor with it. The circuit is ready to run immediately — just click Run.
Shared URLs are permanent. The snippet ID does not expire and the code is not modified after creation.
The clipboard copy happens automatically when you click Share. If your browser blocks clipboard access (for example, because the page is not in focus or the permission has been denied), the URL is still displayed in the toolbar input and can be copied manually.