Skip to content

Allowed Domains ​

Choose the websites your map may be shown on.

How It Works ​

When allowed domains are configured, the embedded map loads only on pages whose domain is on the list. On any other page the visitor sees, instead of the map, a card that says "Couldn't load the map" and, under it, "This map isn't allowed on this domain. Check the project's Allowed Domains setting." The map also takes SDK commands only from a page on the list, and does not send its events to a page it can see is not on it.

What It Is Not ​

Allowed Domains decides where your map appears. It does not make the map's content private.

  • A published map is public: its places, texts and photos are what every visitor's browser downloads. Do not put anything on a published map that only some people may see.
  • The check relies on what the visitor's browser reports about the page the map sits on. A browser does that honestly, so the map will not show up on someone else's site for ordinary visitors. A script outside a browser can report whatever it likes and read the published data.
  • A page that hides where it comes from (Referrer-Policy: no-referrer, in a browser that does not name the embedding page) cannot be checked, and the map loads there rather than break on your own site.

Configuring Domains ​

  1. Open your project in the editor
  2. Open the Settings panel in the editor sidebar
  3. Add domains in the Allowed Domains section
  4. Save

Examples ​

Domain entryMatches
example.comhttps://example.com/*
*.example.comhttps://shop.example.com/*, https://blog.example.com/*
localhosthttp://localhost:* (for development)

Loading the Map Outside the List ​

A page on one of the allowed domains needs no key. To load the map anywhere else — a page that is not on the list, a mobile app, a script that calls the public API — pass a read API key:

html
<script src="https://app.layota.app/embed.js"></script>
<layota-map
  src="https://app.layota.app/embed/PROJECT_ID?apiKey=sk_..."
  style="width: 100%; height: 600px;"
></layota-map>

Or with iframe:

html
<iframe src="https://app.layota.app/embed/PROJECT_ID?apiKey=sk_..."></iframe>

Or with the SDK:

typescript
const map = new LayotaMap({
  container: '#map',
  projectId: 'PROJECT_ID',
  apiKey: 'sk_...',
})

Use a read key here, never a write key: whatever is in the embed code can be copied by anyone who opens the page source. A read key reads published maps only, and the embed refuses a write key. Keep in mind that the map loads from any site with that key — add it only where you need it, and revoke it in Dashboard → API Keys if it is misused.

See API Keys for key types and key management.

No Domains Set ​

If no allowed domains are configured, the map can be embedded on any website without an API key. This is the default for new projects.

Layota Documentation