> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trimyourl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chrome extension

> Shorten the current tab into a TrimYourl workspace and copy the short URL.

The TrimYourl extension shortens the page you are looking at into the workspace that owns your API key. It copies the short URL and shows a QR code from the workspace kit.

## Install

Load the unpacked folder from this repo. There is no Chrome Web Store listing yet.

**1. Load unpacked**

In Chrome, open `chrome://extensions`. Turn on **Developer mode**. Click **Load unpacked** and select the `extension/` directory in the TrimYourl repo. Pin it to the toolbar so it is one click away.

**2. Create an API key**

In TrimYourl, open **Settings → API**. Name the key (for example `Laptop`) and create it.

Copy the secret now. It starts with `tyl_` and is shown once. The key is tied to the **current workspace**, so switch to the client you want before you create it.

**3. Connect the key**

Click the extension icon. Set the base URL to `https://trimyourl.com` (or `http://localhost:3000` for local). Paste the API key and press **Save key**.

## Shorten a tab

1. Open a normal `https://` page (not `chrome://` or the Chrome Web Store).
2. Click the extension and press **Shorten this tab**. Creating a link can take a few seconds while TrimYourl reads the destination.
3. The short URL is copied to the clipboard. A QR preview appears from the workspace kit.

The request is `POST /api/v1/links` with the tab URL and title, then `GET /api/v1/qr?id=…`. See the [API reference](https://docs.trimyourl.com/api-reference/introduction.md).

## Permissions

The extension asks for:

* `activeTab` and `tabs` — read the current tab URL and title
* `storage` — save the base URL and API key
* `clipboardWrite` — copy the short URL
* Host access to `https://trimyourl.com`, `https://www.trimyourl.com`, and local `http://localhost:3000`

## Troubleshooting

> [accordion] Paste a tyl\_ API key
>
> The popup shows this when the key field is empty. Create a key under **Settings → API**, paste it, and press **Save key**.

> [accordion] Open a normal http(s) page
>
> Chrome pages (`chrome://`), the Web Store, PDFs in the Chrome viewer, and empty new tabs have no public URL. Open a website, then shorten.

> [accordion] Could not shorten / 401
>
> The key is wrong or was created in a different workspace. Create a new key while that client is selected.

> [accordion] Could not reach that base URL
>
> The extension can only call `https://trimyourl.com`, `https://www.trimyourl.com`, or `http://localhost:3000`. Check the base field.

> [accordion] No domain is ready
>
> The workspace has no active domain. Wait for the TrimYourl subdomain, or [verify a custom domain](https://docs.trimyourl.com/features/custom-domains.md).

> [accordion] QR image missing
>
> The short URL still copied. The QR request needs the same key and the new link id. Check that the kit colors are valid hex in **QR kit**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.