Coming soon

The Storefront API isn’t open to developers yet. This is a preview of the docs, and details may change before launch.

Guides

Branding and content

Merchants design their store in the Storepecker dashboard. These two calls let your storefront follow those choices, so the merchant can change colours, fonts, the ribbon bar or banners without asking you.

Settings: GET /v1/storefront/settings

Ask for only what you use with include (default: everything):

GET /v1/storefront/settings?include=colors,fonts,ribbon
ItemContains
colorsprimary, secondary, background, background_alt, border, text, text_muted, button_text, header_background, footer_background, footer_text
fontsheading and body: name, weight, stylesheet_url
imageslogo_url, secondary_logo_url, favicon_url, social_image_url
ribbonThe ribbon (announcement) bar: messages (text and link), text_color, position (top/bottom), animation, interval_seconds; null when off
headernavigation items, logo_position, show_cart, show_wishlist
footerWhich footer elements the merchant shows
social_linksInstagram, Facebook, Twitter, LinkedIn, YouTube URLs
contactEmail and phone, only if the merchant shows them publicly; otherwise null
seoSite title and description
analyticsGoogle Tag Manager and Facebook Pixel IDs

Every value is validated: colours are real CSS colours, links are https:// or site-relative paths.

Apply colours and fonts in one line

import { toCssText, fontStylesheets } from '@storepecker/storefront-sdk';

const settings = await client.store.settings(['colors', 'fonts']);
// <head>
{fontStylesheets(settings).map((href) => <link rel="stylesheet" href={href} />)}
<style>{toCssText(settings)}</style>
// then in CSS: color: var(--sp-color-primary); font-family: var(--sp-font-heading);

Content: GET /v1/storefront/content

Everything the merchant set up on their Customise page, by type. You choose where and how to show it; the API doesn't impose a page layout.

GET /v1/storefront/content?type=hero,banners,instagram
typeEach block contains
heroimage_url, mobile_image_url, title, button_text, button_link, slides, interval_seconds (null when off)
bannersimage_url, mobile_image_url, title, description, button_text, button_link, link, show_text; slides of one slider share a group_id
video_bannersvideo_url or mux_playback_id, thumbnail_url, title, button_*, show_overlay
gallerytitle, link, photos (image_url, link)
image_with_textimage_url, title, text, image_position, button_*
info_blocksitems (image_url, title, description)
value_highlightstitle, description, items (value, label, image_url)
featured_categoriestitle, style, categories (id, name, slug)
featured_productstitle and either product (pass to GET /v1/products/{id}) or filters (pass to GET /v1/products)
featured_collectionstitle, collection (slug)
featured_blog_poststitle, posts (slugs)
store_reviewstitle, selection (top_rated or mixed), count, star_color, autoplay
instagramtitle, username, show_date, show_caption, posts: type (image, video for reels, carousel), media_url, thumbnail_url, permalink, caption, posted_at

Every block has an id and a page (home or shop) saying where the merchant meant it to appear.

Notes:

  • Instagram media URLs are signed by Instagram and expire: fetch them when rendering (or cache for minutes, not days).
  • Play mux_playback_id with any HLS player from https://stream.mux.com/{id}.m3u8.
  • Blocks with missing images or invalid links are left out.
const { hero, banners, instagram } = await client.store.content(['hero', 'banners', 'instagram']);