> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shoppex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Store API

> Fetch store metadata, branding, and configuration

The Store API provides access to your shop's public information including name, branding, and settings.

<Tip>
  For simple use cases like displaying the store logo, use `getStoreLogoUrl()` or `getStoreBannerUrl()` — they are lightweight wrappers that avoid fetching the full store metadata.
</Tip>

## getStore

Fetches the store's public metadata.

```javascript theme={"system"}
const { data: store } = await shoppex.getStore();

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

### Response

<ResponseField name="data" type="Shop">
  <Expandable title="Shop object">
    <ResponseField name="id" type="string">
      Unique store identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Store display name
    </ResponseField>

    <ResponseField name="slug" type="string">
      URL-friendly store identifier
    </ResponseField>

    <ResponseField name="domain" type="string">
      Custom domain if configured
    </ResponseField>

    <ResponseField name="description" type="string">
      Store description
    </ResponseField>

    <ResponseField name="currency" type="string">
      Default currency (ISO 4217)
    </ResponseField>

    <ResponseField name="logo" type="string">
      Logo image URL
    </ResponseField>

    <ResponseField name="banner" type="string">
      Banner image URL
    </ResponseField>

    <ResponseField name="rating" type="number">
      Average store rating (1-5)
    </ResponseField>

    <ResponseField name="tos_enabled" type="boolean">
      Whether terms of service are enabled
    </ResponseField>

    <ResponseField name="social" type="object">
      Social media links

      <Expandable>
        <ResponseField name="discord" type="string">Discord URL</ResponseField>
        <ResponseField name="twitter" type="string">Twitter URL</ResponseField>
        <ResponseField name="instagram" type="string">Instagram URL</ResponseField>
        <ResponseField name="facebook" type="string">Facebook URL</ResponseField>
        <ResponseField name="telegram" type="string">Telegram URL</ResponseField>
        <ResponseField name="youtube" type="string">YouTube URL</ResponseField>
        <ResponseField name="reddit" type="string">Reddit URL</ResponseField>
        <ResponseField name="tiktok" type="string">TikTok URL</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Example: Display Store Header

```javascript theme={"system"}
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.

```javascript theme={"system"}
const logoUrl = await shoppex.getStoreLogoUrl();

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

### Response

<ResponseField name="return" type="string | null">
  Logo URL or `null` if no logo is set
</ResponseField>

## getStoreBannerUrl

Returns the store's banner URL directly.

```javascript theme={"system"}
const bannerUrl = await shoppex.getStoreBannerUrl();

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

### Response

<ResponseField name="return" type="string | null">
  Banner URL or `null` if no banner is set
</ResponseField>

## Error Handling

```javascript theme={"system"}
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.');
  }
}
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Products API" icon="box" href="/sdk/api/products">
    Fetch products, variants, and categories
  </Card>

  <Card title="SDK Types" icon="code" href="/sdk/types">
    Full TypeScript type reference
  </Card>
</CardGroup>
