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
| Item | Contains |
|---|---|
colors | primary, secondary, background, background_alt, border, text, text_muted, button_text, header_background, footer_background, footer_text |
fonts | heading and body: name, weight, stylesheet_url |
images | logo_url, secondary_logo_url, favicon_url, social_image_url |
ribbon | The ribbon (announcement) bar: messages (text and link), text_color, position (top/bottom), animation, interval_seconds; null when off |
header | navigation items, logo_position, show_cart, show_wishlist |
footer | Which footer elements the merchant shows |
social_links | Instagram, Facebook, Twitter, LinkedIn, YouTube URLs |
contact | Email and phone, only if the merchant shows them publicly; otherwise null |
seo | Site title and description |
analytics | Google 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
type | Each block contains |
|---|---|
hero | image_url, mobile_image_url, title, button_text, button_link, slides, interval_seconds (null when off) |
banners | image_url, mobile_image_url, title, description, button_text, button_link, link, show_text; slides of one slider share a group_id |
video_banners | video_url or mux_playback_id, thumbnail_url, title, button_*, show_overlay |
gallery | title, link, photos (image_url, link) |
image_with_text | image_url, title, text, image_position, button_* |
info_blocks | items (image_url, title, description) |
value_highlights | title, description, items (value, label, image_url) |
featured_categories | title, style, categories (id, name, slug) |
featured_products | title and either product (pass to GET /v1/products/{id}) or filters (pass to GET /v1/products) |
featured_collections | title, collection (slug) |
featured_blog_posts | title, posts (slugs) |
store_reviews | title, selection (top_rated or mixed), count, star_color, autoplay |
instagram | title, 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_idwith any HLS player fromhttps://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']);