# SDK Reference


Complete API reference for the Marketfront SDK.

## Overview

The Marketfront SDK provides a Web Component for embedding the ordering experience into web applications.

| Package | Import |
|---------|--------|
| `@gett-co/marketfront` | `<gett-marketfront>` element (auto-registered), `GettMarketfrontElement`, `register()` |

## Reference Sections

- **[Element](/distribution-partners/marketfront-sdk/sdk-reference/element)** -- Web Component attributes, properties, methods, and events
- **[Events](/distribution-partners/marketfront-sdk/sdk-reference/events)** -- Event payload type definitions and signatures

Type definitions ship as `.d.ts` in the npm package — your IDE will autocomplete and document each interface in place.

## Quick Start

```html
<gett-marketfront session-token="tok_abc123"></gett-marketfront>

<script type="module">
  import '@gett-co/marketfront';

  const el = document.querySelector('gett-marketfront');
  el.onOrderComplete = (order) => {
    console.log('Order placed:', order.id);
  };
</script>
```

## API at a Glance

### Attributes

| Attribute | Description |
|-----------|-------------|
| `session-token` | Partner session token (optional for anonymous browsing) |
| `base-url` | Override base URL (development only) |

### Methods

| Method | Description |
|--------|-------------|
| `setSessionToken(token)` | Update the session token without remounting |

### Events

| Event | Description |
|-------|-------------|
| `onReady` / `ready` | Element is initialized and ready |
| `onError` / `error` | An error occurred |
| `onStoreSelected` / `storeselected` | User selected a store |
| `onItemAdded` / `itemadded` | Item added to cart |
| `onCheckoutStarted` / `checkoutstarted` | Checkout flow began |
| `onOrderComplete` / `ordercomplete` | Order successfully placed |
