# Linking to BrowserCode

Source: https://browsercode.io/docs/linking

Index of every BrowserCode page: https://browsercode.io/llms.txt

Open a template, repo, example or agent from a URL, in a README or anywhere else.

A link is the simplest way to send someone to BrowserCode. It works anywhere you can paste a URL, including places where an iframe cannot be used: a GitHub README, a chat message, a changelog, or documentation on a site you do not control. Links need no headers, API key or configuration.

To run BrowserCode inside your own page, see [Embedding BrowserCode](https://browsercode.io/docs/embedding).

## What you can link to

-   A template: [browsercode.io/ide?framework=vite](https://browsercode.io/ide?framework=vite)
-   A public GitHub repo, which is cloned and booted. See below.
-   A Java example: [browsercode.io/java?example=swing](https://browsercode.io/java?example=swing)
-   A coding agent: [browsercode.io/agents/claude](https://browsercode.io/agents/claude). The person who opens the link has to sign in before using the agent.
-   A project you shared. Select **Share** in the playground and send the link it copies. The project is encoded in the link.

## Linking to a repo

BrowserCode repo URLs follow the same structure as GitHub URLs:

```
https://github.com/leaningtech/browsercode/tree/main/static
https://browsercode.io/ide/github/leaningtech/browsercode/tree/main/static
```

Replace `github.com` with `browsercode.io/ide/github`. The rest of the path stays the same, including a subdirectory. BrowserCode clones the repo, installs dependencies and runs the project's dev script.

The URL must include a branch, tag or commit, as in `/tree/main/`. URLs copied after selecting a branch on GitHub include one. If you start from a repo's home page URL, add `/tree/<branch>/` yourself.

## Link stability

-   These URL formats are stable.
-   An unknown template or Java example name opens the picker with a message that names the rejected value. A malformed repo link shows an error. An unknown agent id opens Claude Code.
-   To make sure readers see the same code you did, link to a tag or commit instead of a branch.
-   Branch names that contain a slash, such as `release/1.0`, are not supported. Use a tag or commit SHA instead.

## Adding a link to a README

In Markdown:

```
[Open in BrowserCode](https://browsercode.io/ide/github/you/your-repo/tree/main/)
```

In HTML:

```
<a href="https://browsercode.io/ide/github/you/your-repo/tree/main/">
  Open in BrowserCode
</a>
```

To show a button, wrap an image in the same link. There is no official badge yet.

## URL reference

For every URL format, parameter and accepted value, see [Reference](https://browsercode.io/docs/reference). To have an AI assistant generate links for you, give it [llms.txt](https://browsercode.io/llms.txt).

- [Next Embedding BrowserCode](https://browsercode.io/docs/embedding)
