Skip to Content
FeaturesWebsite Embed

Website Embed

The website embed shows a gallery on your own website as a photo grid in an <iframe>. Visitors see the published photos, can open one larger in a lightbox, and can follow a link to the full gallery. They cannot download, comment, like or upload from the embed.

Not released yet. The website embed ships with PicPeak PR #2500 ; this page describes that build.

Enable the feature

The website embed is off by default. Turn it on under Settings → Features → Website embed. While it’s off, no embed section appears in the event settings and every existing embed stays blank (see below).

Which galleries can be embedded

Only a gallery that anyone could open anyway:

  • no gallery password (an embed never asks for one),
  • active and published, not archived, not expired, not paused,
  • not a hidden gallery (reveal mode with the gallery still hidden),
  • not waiting for a booking payment (a payment-locked gallery opens once the deposit is paid).

If a gallery stops meeting one of these, PicPeak no longer allows other websites to frame it: the browser blocks the frame, so the embed stays blank (the browser console reports a refused frame). Once the gallery qualifies again, the embed works on the next page load of the website that shows it. Opened directly in a browser tab, the embed address shows “This gallery is not available.” Setting a password on an embedded gallery pauses the embed; the settings section says so.

Create the embed code

  1. Open the gallery’s Settings → Website embed section.

  2. Click Create embed code. PicPeak creates a code like this:

    <iframe src="https://your-host/gallery/<event-slug>/embed/<token>" title="Summer Party" width="100%" height="600" style="border:0" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" allow="fullscreen"></iframe>
  3. Copy it and paste it into your website where the gallery should appear. Adjust the height to your page.

New code replaces the token: websites that use the old code stop showing the gallery until you paste the new code there. Remove turns the embed off for this gallery.

What visitors see

  • The gallery name and a grid of the published photos, in pages of up to 60 with Load more. Videos are left out.
  • A lightbox with the preview size. As in the gallery, a preview that cannot be served falls back to the original, unless a download limit or photo sales withhold it. The previous/next buttons and the arrow keys step through the photos; Escape closes it.
  • A View full gallery link that opens the normal gallery in a new tab.

Embed views are not counted as gallery visits and do not trigger the “gallery opened” notification.

Limit which websites may embed

By default any website can show the embed code. Under Allowed websites you can name the sites that may, one per line:

https://example.com https://*.example.com
  • Use https:// addresses, optionally with a port. https://*.example.com allows every subdomain of example.com.
  • http:// is accepted only for localhost and 127.0.0.1, for testing.
  • Up to 20 entries. Leave the list empty to allow any website.

PicPeak sends the list to the browser as Content-Security-Policy: frame-ancestors. A browser on any other website refuses to show the frame. This stops other sites from showing your gallery inside their pages; it does not hide the photos, which belong to a gallery without a password and are reachable through its normal link anyway.

Reverse proxies

Your gallery pages normally carry X-Frame-Options: SAMEORIGIN, so no other website can frame them. PicPeak lifts this on the embed path /gallery/<slug>/embed/<token> only, and sends the allowed websites as frame-ancestors there: the bundled frontend nginx and the all-in-one image both do it.

A proxy of your own in front of PicPeak can break the embed on that path. Check for:

  • a Content-Security-Policy with its own frame-ancestors, set by the proxy or by a CDN such as Cloudflare. The browser enforces it in addition to PicPeak’s;
  • X-Frame-Options added by the proxy (many hardening snippets add SAMEORIGIN). Current browsers ignore it while PicPeak’s frame-ancestors is present, older ones do not, and it is the only rule left if the proxy replaces PicPeak’s Content-Security-Policy.

See Reverse Proxy → Website embed for an example.

Good to know

  • The token is the switch. The embed code works only with the current token. New code and Remove take effect for every new page load; a page that is already open keeps the photos it has loaded until it is reloaded.
  • The embed shows what guests see. Photos that are hidden, still in review or rejected stay out of the embed, as they stay out of the gallery.
  • Turning the feature off suspends, doesn’t delete. Existing embed codes stop working while the flag is off and work again when you turn it back on.
Last updated on