llms.txt
Compare with other sites' llms.txt files →# co-mment
> Collaborative visual feedback for the web. A drop-in React widget for
> non-production sites: anyone viewing a staging site can click any element and
> leave a comment, and every comment records the page, the element, a screenshot,
> and the browser it was written in. Threads land in a dashboard, and export as
> agent-ready prompts or Linear issues.
Operated by Planetary Corporation (https://planetary.co).
## Install
```
npm install @planetary/co-mment
```
### Next.js (app/layout.tsx)
```
import { Comment } from "@planetary/co-mment";
{process.env.NEXT_PUBLIC_VERCEL_ENV !== "production" && (
<Comment projectKey="cmt_pk_..." />
)}
```
### Astro (src/layouts/Layout.astro)
Also: `npx astro add react # skip if the project already has the React integration`
```
---
import { Comment } from "@planetary/co-mment";
---
<slot />
{!import.meta.env.PROD && <Comment client:only="react" projectKey="cmt_pk_..." />}
```
### Vite (src/App.tsx)
```
import { Comment } from "@planetary/co-mment";
{!import.meta.env.PROD && (
<Comment projectKey="cmt_pk_..." />
)}
```
### HTML (index.html)
No install and no build step. React is bundled inside a closure, so a page's
own React is untouched, at any version. Prefer the npm package where there is
a bundler: this file is bigger, because React comes with it.
```
<script
src="https://co-mment.com/script/latest.js"
data-project-key="cmt_pk_..."
></script>
```
## Two things to get right
- **Keep it out of production.** The widget is for staging, preview, and local
work. Every example above renders it behind a check for exactly that reason.
- **Origins are allowlisted per project.** The widget API answers only the
origins added to a project in the dashboard, scheme + host + port, no path.
A publishable key (`cmt_pk_...`) is safe in client code; the allowlist, not
the key, is what keeps other sites out.
## Props
`projectKey` (required), `user` ({ name, email }) to pre-fill the commenter,
`disabled` to render nothing, `position` for which corner the toolbar sits in,
and `apiUrl` to point at a different API origin. React 18+ is a peer
dependency. The UI renders in a Shadow DOM root, so it needs no styles or
providers.
## Pages
- [co-mment](https://co-mment.com): Collaborative visual feedback for the web. What the product is, the two-step install, and a live demo of the widget.
- [What is co-mment?](https://co-mment.com/docs): The three roles (commenters, editors, developers), what a comment records, and how a thread reaches a coding agent or Linear.
- [Install](https://co-mment.com/docs/install): Installing the npm package and adding <Comment/> behind a production check, in Next.js, Astro, or Vite, plus the origin allowlist.
- [Anchoring](https://co-mment.com/docs/anchoring): How a pin finds its element again after a redeploy: selector chain, click offsets, text fingerprint, and the exact/drifted/approximate outcomes.
- [Widget API](https://co-mment.com/docs/api): The public /w/* endpoints, their request and response shapes, authentication, errors, and rate limits.
- [Terms of Service](https://co-mment.com/legal/terms): The terms the preview is offered under, and what the widget may be installed on.
- [Privacy Policy](https://co-mment.com/legal/privacy): What a comment stores, which processors see it, how long it is kept, and how to have it deleted.