Docs Demo Dashboard Get your key
On this page
  1. What leaves the page
  2. Content Security Policy
  3. Browser storage

Security, privacy and CSP

There is no SharedLayers server between the page and the database. Everything is authorised in the database against the visitor’s own session.

The script talks directly from the visitor's browser to a Supabase project operated by SharedLayers, using a public client key that is part of the script. Every read and write is authorised in the database by row-level security against the visitor's own session, which is why neither the embed key nor the client key is a secret.

What leaves the page

When a visitor leaves a comment, the following is stored:

Nothing is collected from visitors who never open the toolbar: no analytics, no fingerprint, no cookies. The SharedLayers privacy policy covers the service side.

Content Security Policy

If your site sends a Content-Security-Policy header, add the following. Origins are exact; there is no wildcard SharedLayers domain to allow.

script-src   https://sharedlayers.com;
connect-src  https://mtgpolxyqamundksrksi.supabase.co
       wss://mtgpolxyqamundksrksi.supabase.co;
img-src      https://mtgpolxyqamundksrksi.supabase.co
       https://sharedlayers.com
       https://*.googleusercontent.com
       data: blob:;
style-src    'unsafe-inline';

Why each line:

Google sign-in opens a popup window on sharedlayers.com. Popups are not governed by CSP, but a browser popup blocker will stop it unless it is opened from a click, which it is.

Browser storage

The script writes to localStorage and sessionStorage on your site's origin. It sets no cookies.

KeyHolds
comments-widget-authThe visitor's SharedLayers session, guest or account.
sl-theme-widgetThe light or dark choice made in the account menu.
sl-layer:<site id>The layer last chosen on this site.
sl-key:<key>@<host>The site this key stood for on this host, kept for an hour so that a repeat visit draws the bar before the key check answers.
sl-toolbar-collapsedWhether the visitor folded the button layout away (1) or opened it (0). Only the button and floating layouts write it.
sl-upgrade-pendingSet briefly while a guest is turning into an account.
sl-filters:<user id>:<host>The side panel's filters this person chose on this site, so they are the same on the next visit. Only while signed in.

In sessionStorage, which is this tab's only and goes when it closes:

KeyHolds
cw-draft:<…>A comment or reply being written, so closing the box by accident or a page change does not lose it. Gone once it is sent or cancelled.
cw-reopen-panel, cw-pending-focusKept for one page change while a comment on another page is opened from the side panel: the panel stays open and the comment is shown when the page arrives.

On an app on your own computer, comments are kept in its project folder, and the browser remembers which folder in an IndexedDB database called sharedlayers-local. See Apps on your computer.

Clearing site data for your origin signs the visitor out of SharedLayers on that site and forgets their theme, layer, filters and whether the button was open. It does not delete anything they wrote.