# Share and Embed

In [Export a File](https://codeanimate.dev/docs/exporting.md) you took your animation out of the editor as a file.

Now you will give it an address on the web instead. With it you get two things:

* A **link** that plays your animation where you paste it: in Slack, in Discord, in a post on X.
* An **embed**: an animated image for a README, a docs page, a blog post or Notion.

> [!NOTE]
> Links and embeds are part of **Pro**. On the free plan the menu shows them as **Copy link (Pro)** and **Copy embed (Pro)**, and clicking one shows you what Pro adds.

## Copy the link

Click **Export & Share**, and under **Share** click **Copy link**.

The button changes to `Link copied`, and you have something like this in your clipboard:

```
https://codeanimate.dev/p/Qx7Lp2Vn8KdA
```

The first time you do it, the editor **publishes** your draft. It saves the snippet to your account and gives it that address, which never changes.

### Check it

Open the link in your browser.

You will see the page of your animation:

![The page of a published snippet, with the animation, a Copy code button, and the permalink with Copy link and Copy embed](https://codeanimate.dev/img/docs/permalink-page.png)

Anyone with the link can open it. They don't need an account.

On that page they can watch the animation, get the code with **Copy code**, and start their own with **Make your own**.

## Paste the link in a chat

Now paste the link in a Slack or Discord message.

You will see the animation **playing right there, in the message**. Nobody has to click anything. 🚀

What people see depends on the app where you paste it:

| Where you paste the link | What people see |
|---|---|
| Slack, Discord | The animation, playing in the link's preview. |
| X | A player in the post that runs the animation. |
| LinkedIn, iMessage, WhatsApp, Facebook, Telegram and other apps | A picture of the finished code. |

In all of them, clicking the preview opens the page of your animation.

> [!NOTE]
> **Technical Details**
>
> A link's preview is a picture that the app asks for. Slack and Discord play a GIF when they are given one, so they are given your animation as a GIF. X can frame a small page in a post, so it's given a player.
>
> The other apps don't play GIFs in a preview. They would show its first frame, which is an empty window, so they get a picture of the finished code instead.
>
> A few snippets can't be made into a GIF: a very large one, or one with wide scripts or emoji in the code, like Chinese, Japanese, Korean or Arabic text. Those show the picture of the finished code everywhere.

> [!TIP]
> Do you need the animation to play in one of those other apps? [Export a GIF or an MP4](https://codeanimate.dev/docs/exporting.md) and attach the file to your message.

## Copy the embed

A link is perfect for a chat. For a page that you write, like a README, you want the animation **in the page**.

Click **Export & Share**, and then **Copy embed**.

The button changes to `Embed Markdown copied`. This time you have a line of Markdown:

```md
[![users.py](https://codeanimate.dev/api/embed/Qx7Lp2Vn8KdA.svg)](https://codeanimate.dev/p/Qx7Lp2Vn8KdA?copy=1)
```

Paste it in your `README.md`, commit, and push.

### Check it

Open your README on GitHub.

You will see your animation playing in the page, like this one:

[![users.py: focus on step 2, the Type effect on step 3](https://codeanimate.dev/api/embed/DXn8BXoLMCXli55ZPsYapQ.svg)](https://codeanimate.dev/p/DXn8BXoLMCXli55ZPsYapQ?copy=1)

That's not a video, and there's no JavaScript. It's an image, an animated SVG, so it plays wherever images are shown. And it stays sharp at any size.

That line of Markdown has two parts:

* The **image**, `…/api/embed/<id>.svg`, is your animation.
* The **link** around it goes to the page of your animation. The `?copy=1` at the end copies the code for whoever clicks. So your readers can watch the code, and then take it.

> [!TIP]
> That's how the code examples in these docs work. Each one is an embed, made with the line that **Copy embed** gives you.

## When an animated SVG doesn't play

Some places show images but freeze an animated SVG, or remove it.

For those, change `.svg` to `.gif` at the end of the image's address:

```md
![users.py](https://codeanimate.dev/api/embed/Qx7Lp2Vn8KdA.gif)
```

It's the same animation, as a GIF. And with `.png` you get a picture of the finished code.

The [Embedding Guide](https://codeanimate.dev/docs/embedding.md) has the list of places and what works in each one.

## The limit: 60 seconds

Anything you share has to loop in 60 seconds or less.

If your animation is longer, **Copy link** and **Copy embed** are turned off, and they tell you why when you point at them. Make the animation shorter in the [Motion tab](https://codeanimate.dev/docs/effects.md#set-the-timing).

## Recap

With **Copy link** and **Copy embed** your animation has a permanent address, and:

* The **link** plays in Slack, Discord and X, and shows a picture of your code everywhere else.
* The **embed** plays in READMEs, docs, blogs and Notion.
* Your readers can copy the code with one click.

But the best part is that the address never changes, even when your code does.

Next, you will update a snippet everywhere at once, with [Live Embeds](https://codeanimate.dev/docs/live-embeds.md).
