Web
Integrate the Marketfront SDK into your website using the @gett-co/marketfront package.
Prerequisites
Before you begin, make sure you have:
- An API key from the developer portal
- A sandbox session token (see Authentication guide)
- Node.js 18+ and npm/pnpm/yarn
Install the SDK
Add the Marketfront SDK to your project.
First, configure registry access in your project's .npmrc:
Code
Then install the package:
Code
Create a Session
Your backend creates a session with the user's context. The session token authorizes the SDK to load the ordering experience.
server.ts
:::tip Anonymous Browsing
The session-token attribute is optional. Without one, the SDK loads in anonymous browsing mode — users can browse stores and menus, and the embed prompts for sign-in when they reach a checkout action. See the Sessions guide for details on the in-embed sign-in flow.
:::
Mount the SDK
The <gett-marketfront> Web Component auto-registers when you import the package. Just add it to your page.
Vanilla TypeScript
Code
Or use it directly in HTML:
Code
React
For TSX consumers, opt into intrinsic-element typing for <gett-marketfront> by adding the subpath to your tsconfig.json:
Code
This is a pure type-only side-file — no runtime React code is shipped by the SDK.
React 19 binds custom-element on* props case-preservingly, so the JSX
prop names mirror the dispatched kebab-case event names:
Code
Vue
Code
Angular
Code
Handle Events
Subscribe to lifecycle events with addEventListener. Every event is a
CustomEvent
with its payload in event.detail.
Code
See the Events Guide for detailed event handling and the SDK Reference for complete type definitions.
Sandbox Environment
Use the sandbox environment to develop and test your integration without affecting production data. The sandbox provides test stores, test payment methods, and simulated order completion.
Sandbox API base URL: https://api-sandbox.gett-tech.com
In the sandbox, orders are automatically completed after placement. No real payments are processed.
Test stores are pre-configured in the sandbox environment. After creating your sandbox API key in the partner portal, you will receive access to test stores for your integration.
Test payment methods are available in the sandbox -- no real payments are processed. Use any valid-format card number (e.g., 4242 4242 4242 4242) to simulate successful payments.
For sandbox credentials and test store details, contact [email protected] or visit the partner portal.
Going to Production
When you're ready, switch from sandbox to production:
- Update your API endpoint from
api-sandbox.gett-tech.comtoapi.gett-tech.com - Use your Production API Key instead of the sandbox key
No client-side SDK changes are needed -- the session token handles everything.
Next Steps
Explore the SDK Reference for all configuration options, read the Events Guide for detailed event handling, and review the Sessions guide to learn about session creation and user context.