Skip to main content

Building Your First App

This guide walks you through building a complete LaunchMyStore app from scratch. By the end, you’ll have a working embedded app that can read products and display them in the admin.

What We’re Building

A simple “Product Insights” app that:
  • Authenticates via OAuth
  • Embeds in the LaunchMyStore admin
  • Fetches and displays product data
  • Uses App Bridge for native UI elements

Prerequisites

  • Node.js 18 or higher
  • A LaunchMyStore developer account
  • Basic knowledge of JavaScript/React

Part 1: Project Setup

Create the Project

Install Dependencies

Project Structure

Part 2: Configure Environment

Create a .env file:
Use ngrok or Cloudflare Tunnel to expose your local server during development.

Where secrets live

Your app’s backend runs on your own infrastructure — LaunchMyStore never hosts or executes your server code. That means every server-side secret (LMS_CLIENT_SECRET, third-party provider keys like OPENAI_API_KEY, database URLs) is stored and injected by your hosting platform’s environment/secret manager (Vercel, Railway, Fly, AWS Secrets Manager, …), exactly as for any web service you deploy. There is no LaunchMyStore-side secret vault, and no dashboard field should ever contain a provider key:
  • The per-installation settings bag and extension block settings are merchant-visible (and block settings can render into public storefront output) — configuration, not secrets.
  • Nothing the platform sends your frontend (session tokens, host param, extension context, app metadata) should embed secrets, and nothing needs to: the embedded iframe calls your backend with a session token, your backend verifies it and then talks to your providers with keys from its own environment.
  • Rotating a provider key is therefore entirely on your side — no app rebuild, reinstall or LaunchMyStore change involved. The one secret the platform does hold, your client_secret, can be regenerated any time in the Developer Portal (App → Settings → Regenerate secret) and takes effect immediately.
  • Use separate LaunchMyStore apps (separate client_id/client_secret pointing at your staging URL) for dev/staging vs production.

Part 3: Build the Server

server.js

Your app gets its access token through the managed install handoff: when a merchant installs the app, LaunchMyStore redirects their browser to your /auth endpoint with an HMAC-signed query string containing a pre-authorized code. There is no app-initiated redirect to /apps/oauth/authorize — that endpoint is a merchant-authenticated JSON API used by the admin.

lib/session.js

Simple in-memory session storage keyed by the immutable storeId (use a database in production):

Part 4: Build the Frontend

public/app.html

Part 5: Run and Test

Start the Server

Expose with ngrok

Update Your App Settings

  1. Go to your app in the developer dashboard
  2. Update the App URL to your ngrok URL — the platform redirects merchants to {appUrl}/auth at install time

Install the App

In the Developer Portal, open your app and click Install on My Store (private apps) or install it from the marketplace listing (published public apps). LaunchMyStore redirects the browser to your https://your-ngrok-url/auth handler with the signed code — that is where your server exchanges it for tokens.

Next Steps

Add Extensions

Extend storefronts and checkout

Add Functions

Custom shipping and payment logic

Webhooks

React to store events in real-time

Billing

Monetize your app