Sharing canvases
Share links let anyone view a canvas without a CanvasMesh account. You control when they expire and can revoke them at any time.
Visibility levels
Section titled “Visibility levels”| Level | Who can view |
|---|---|
private | Only the owner |
public | Anyone with the canvas URL |
Set visibility at create time or with an update call. Share links (below) are orthogonal — a private canvas can still have a public share link.
Create a share link
Section titled “Create a share link”canvasmesh share cv_abc123 --expires 7dAccepted durations: 30m, 24h, 7d, etc. Omit --expires for a link that never expires.
const share = await client.share('cv_abc123', { expiresIn: '7d' });console.log(share.url); // https://canvasmesh.app/s/<token>console.log(share.token); // short opaque tokencurl -X POST https://api.canvasmesh.app/v1/canvases/cv_abc123/share \ -H "Authorization: Bearer $CANVASMESH_API_KEY" \ -H "Content-Type: application/json" \ -d '{"expires_in": "7d"}'Access a shared canvas
Section titled “Access a shared canvas”Share URLs are under https://canvasmesh.app/s/<token> and render the canvas in the viewer. To download the raw file:
curl "https://api.canvasmesh.app/share/<token>/content?dl=1" -o downloaded.fileThe CLI download command handles this for you:
canvasmesh download https://canvasmesh.app/s/<token> -o ./downloaded.fileRevoke share links
Section titled “Revoke share links”curl -X DELETE https://api.canvasmesh.app/v1/canvases/cv_abc123/share \ -H "Authorization: Bearer $CANVASMESH_API_KEY"This invalidates all share links for that canvas. Create a new share call to issue a replacement.
View count
Section titled “View count”Each share token tracks how many times it has been accessed. Fetch via the canvas detail API (see REST reference).