Skip to main content
The Store API provides access to your shop’s public information including name, branding, and settings.

getStore

Fetches the store’s public metadata.
const { data: store } = await shoppex.getStore();

console.log(store.name);     // "My Awesome Store"
console.log(store.currency); // "USD"

Response

data
Shop

Example: Display Store Header

async function renderStoreHeader() {
  const { data: store } = await shoppex.getStore();

  document.getElementById('store-header').innerHTML = `
    <img src="${store.logo}" alt="${store.name}" class="logo" style="border-radius: 9999px;">
    <h1>${store.name}</h1>
    ${store.rating ? `<span class="rating">${store.rating.toFixed(1)} / 5</span>` : ''}
  `;
}

getStoreLogoUrl

Returns the store’s logo URL directly.
const logoUrl = await shoppex.getStoreLogoUrl();

if (logoUrl) {
  document.getElementById('logo').src = logoUrl;
}

Response

return
string | null
Logo URL or null if no logo is set

getStoreBannerUrl

Returns the store’s banner URL directly.
const bannerUrl = await shoppex.getStoreBannerUrl();

if (bannerUrl) {
  document.getElementById('hero').style.backgroundImage = `url(${bannerUrl})`;
}

Response

return
string | null
Banner URL or null if no banner is set

Error Handling

try {
  const { data, success, message } = await shoppex.getStore();

  if (!success) {
    console.error('Failed to load store:', message);
    return;
  }

  // Use store data
} catch (error) {
  if (error.name === 'NotInitializedError') {
    console.error('SDK not initialized. Call shoppex.init() first.');
  } else if (error.name === 'NetworkError') {
    console.error('Network error. Check your connection.');
  }
}