Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Prerequisites

Node.js 18+

Required for development

Developer Account

Sign up for free

Step 1: Create a Developer Account

  1. Go to app.launchmystore.io/developer
  2. Sign up or log in with your LaunchMyStore account
  3. Navigate to Apps in the developer dashboard

Step 2: Create Your App

1

Click Create App

In the developer dashboard, click the Create App button.
2

Configure App Details

Fill in your app information:
  • App name: A descriptive name for your app
  • App handle: URL-safe identifier (e.g., my-awesome-app)
  • App URL: Where your app is hosted (e.g., https://my-app.com)
  • Redirect URLs: OAuth callback URLs
3

Select Scopes

Choose the permissions your app needs:
read_products, write_products
read_orders, write_orders
read_customers
4

Save Credentials

After creation, you’ll receive:
  • Client ID: Public identifier for your app
  • Client Secret: Keep this secure, never expose publicly

Step 3: Set Up Your Project

Create a new project with your preferred framework:
mkdir my-lms-app && cd my-lms-app
npm init -y
npm install express @launchmystore/app-bridge

Step 4: Implement OAuth

Create your OAuth callback handler:
server.js
const express = require('express');
const app = express();

const CLIENT_ID = process.env.LMS_CLIENT_ID;
const CLIENT_SECRET = process.env.LMS_CLIENT_SECRET;
const REDIRECT_URI = 'https://my-app.com/auth/callback';

// OAuth install endpoint
app.get('/auth/install', (req, res) => {
  const { shop } = req.query;
  const scopes = 'read_products,write_products,read_orders';
  
  const authUrl = `https://api.launchmystore.io/oauth/authorize?` +
    `client_id=${CLIENT_ID}&` +
    `scope=${scopes}&` +
    `redirect_uri=${REDIRECT_URI}&` +
    `state=${shop}`;
  
  res.redirect(authUrl);
});

// OAuth callback
app.get('/auth/callback', async (req, res) => {
  const { code, state: shop } = req.query;
  
  const response = await fetch('https://api.launchmystore.io/oauth/token', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      client_id: CLIENT_ID,
      client_secret: CLIENT_SECRET,
      code,
      grant_type: 'authorization_code',
      redirect_uri: REDIRECT_URI
    })
  });
  
  const { access_token, refresh_token } = await response.json();
  
  // Store tokens securely associated with the shop
  await saveTokens(shop, access_token, refresh_token);
  
  res.redirect(`/app?shop=${shop}`);
});

app.listen(3000);

Step 5: Make API Calls

Use your access token to call the API:
const accessToken = await getAccessToken(shop);

const response = await fetch('https://api.launchmystore.io/api/v1/products', {
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'Content-Type': 'application/json'
  }
});

const products = await response.json();

Step 6: Add App Bridge (Embedded Apps)

If your app is embedded in the LaunchMyStore admin:
import { createApp } from '@launchmystore/app-bridge';

const app = createApp({
  apiKey: 'your-client-id',
  host: new URLSearchParams(location.search).get('host')
});

// Show a toast notification
app.dispatch({
  type: 'TOAST',
  payload: { message: 'Hello from my app!', duration: 3000 }
});

Next Steps

Build Extensions

Add UI to storefronts, checkout, and admin

Create Functions

Custom logic for shipping, payments, and more

App Bridge

Communicate with the host application

API Reference

Full REST API documentation