misoapps
Miso Apps SDK
SDKs for email services and shop management in Shopify applications.
Installation
npm install @misoapps/mail-sdk @misoapps/shop-sdk
Mail SDK (@misoapps/mail-sdk)
Setup
import { createMailClient } from '@misoapps/mail-sdk';
const mailClient = createMailClient({
endpoint: 'https://mail-service.example.com',
shopDomain: 'my-shop.myshopify.com', // Required for User SMTP APIs
});
Send Email (User SMTP)
const result = await mailClient.sendEmail({
to: 'customer@example.com',
fromEmail: 'shop@example.com',
fromName: 'My Shop', // optional
replyTo: ['support@example.com'], // optional
subject: 'Hello!',
html: '<h1>Welcome!</h1>',
text: 'Welcome!', // optional
});
// { success: true, messageId: '...', logId: '...' }
Send Email (System SMTP - AWS SES)
fromEmail is fixed from server's AWS_SMTP_FROM_EMAIL env:
const result = await mailClient.sendSystemEmail({
to: 'customer@example.com',
fromName: 'Miso Apps', // optional
replyTo: ['support@example.com'], // optional
subject: 'Hello!',
html: '<h1>Welcome!</h1>',
text: 'Welcome!', // optional
});
Get Email Logs
const logs = await mailClient.getEmailLogs({
status: 'sent', // optional: 'pending' | 'sent' | 'failed'
type: 'user', // optional: 'user' | 'system'
page: 1, // optional
limit: 20, // optional
});
// { logs: [...], total: 100, page: 1, pages: 5 }
SMTP Configuration
// Create/Update (upsert)
const config = await mailClient.upsertSmtpConfig({
host: 'smtp.gmail.com',
port: 587, // optional, default: 587
secure: false, // optional, default: false
username: 'user@gmail.com',
password: 'app-password',
});
// Get
const config = await mailClient.getSmtpConfig(); // SmtpConfig | null
// Update (partial)
await mailClient.updateSmtpConfig({
port: 465,
secure: true,
isActive: true,
});
// Delete
await mailClient.deleteSmtpConfig();
// { success: true, message: '...' }
// Test connection
const result = await mailClient.testSmtpConnection();
// { success: true, message: 'SMTP connection successful' }
// or { success: false, message: '...', error: '...' }
Mail SDK Types
import type {
MailClientConfig, MailClient,
SendEmailRequest, SendSystemEmailRequest, SendEmailResponse,
EmailLog, GetEmailLogsParams, GetEmailLogsResponse,
EmailStatus, EmailType,
SmtpConfig, CreateSmtpConfigRequest, UpdateSmtpConfigRequest, TestSmtpResponse,
} from '@misoapps/mail-sdk';
Shop SDK (@misoapps/shop-sdk)
Setup
import { createShopServices, Platform, AppID } from '@misoapps/shop-sdk';
const shopService = createShopServices(
'http://localhost:5000',
'shopify' // Platform: 'shopify' | 'shopline'
);
Install App
const result = await shopService.installApp({
shop: 'example.myshopify.com',
shopName: 'Example Shop',
contactEmail: 'contact@example.com',
themeId: 'theme-123', // optional
app: {
appId: 'llmstxt', // AppID
plan: 'basic',
accessToken: 'token', // optional
},
});
// { message: 'App installed successfully', status: 'NEW' | 'INSTALLED' | 'REINSTALLED', shop: IShop }
Uninstall App
const result = await shopService.uninstallApp({
shop: 'example.myshopify.com',
appId: 'llmstxt',
});
// { message: 'App uninstalled successfully', shop: IShop }
Get App
const { shop, app } = await shopService.getApp('example.myshopify.com', 'llmstxt');
// shop: IShop (without apps array), app: IAppInfo
Update App
const { shop, app } = await shopService.updateApp(
'example.myshopify.com',
'llmstxt',
{
plan: 'premium', // optional
isReviewed: true, // optional
accessToken: 'new-token', // optional
}
);
Shop Queries
// Get single shop
const { shop } = await shopService.getShop('example.myshopify.com');
// Get shop's apps
const { apps } = await shopService.getShopApps('example.myshopify.com');
// List shops (paginated)
const { shops, total, page, pages } = await shopService.listShops({
page: 1, // default: 1
limit: 10, // default: 10
platform: 'shopify', // optional filter
});
// Find recently uninstalled (last 10 days)
const { shops } = await shopService.findUninstalledShops('llmstxt');
// Get stats
const stats = await shopService.getStats();
// { totalShops, totalInstalls, activeInstalls }
Shop SDK Types
import type {
Platform, AppID, Shop, AppInfo,
InstallAppPayload, InstallAppResponse,
UninstallAppPayload, UninstallAppResponse,
UpdateAppPayload, UpdateAppResponse,
GetAppResponse, GetShopResponse, GetShopAppsResponse,
ListShopsResponse, FindUninstalledShopsResponse, GetStatsResponse,
} from '@misoapps/shop-sdk';
Environment Variables
MAIL_SERVICE_ENDPOINT=https://mail-api.misoapps.com
SHOP_SERVICE_ENDPOINT=https://shop-api.misoapps.com
Integration with Remix
See references/remix-integration.md for Remix loader/action patterns.
More from toilahuongg/shopify-agents-kit
shopify-polaris-icons
Guide for using Shopify Polaris Icons in Shopify Apps. Covers icon usage patterns, accessibility, tone variants, and common icon categories for commerce applications.
19email-template-design
Design and build professional HTML email templates with inline CSS for broad email client compatibility. Use this skill when the user asks to create, design, or build email templates, newsletters, transactional emails (order confirmations, receipts, shipping notifications, password resets), marketing emails, welcome series, onboarding emails, abandoned cart emails, drip campaigns, or any HTML email layout. Covers responsive design, dark mode support, and compatibility with Gmail, Outlook (desktop + web), Apple Mail, Yahoo, and mobile clients.
18shopify-extensions
Guide for building and managing Shopify Extensions (Admin, Checkout, Theme, Post-purchase, etc.) using the latest Shopify CLI and APIs.
14shopify-api
Comprehensive guide for Shopify APIs in Remix apps. Covers Admin GraphQL/REST, Storefront API, all resources (products, orders, customers, inventory, collections, discounts, fulfillments, metafields, files), bulk operations, webhooks, resource pickers, and TypeScript patterns. Use when querying/mutating Shopify data or building integrations.
14shopify-polaris-viz
Guide for creating data visualizations in Shopify Apps using the Polaris Viz library. Use this skill when building charts, graphs, dashboards, or any data visualization components that need to integrate with the Shopify Admin aesthetic. Covers BarChart, LineChart, DonutChart, SparkLineChart, and theming.
13code-investigator
Comprehensive code investigation and audit tool. Discovers all project features, then dispatches parallel subagents to analyze issues, risks, dead code, missing functionality, and redundancies. Produces a prioritized risk report. Use this skill when the user asks to "investigate code", "audit project", "find risks", "check code quality", "analyze codebase", "what's wrong with this code", "project health check", "code review entire project", "find dead code", "find redundant code", or any request for a thorough codebase analysis.
11