| name | misoapps |
| description | Guide for using Miso Apps SDKs (@misoapps/mail-sdk and @misoapps/shop-sdk) in Shopify apps. Use this skill when the user needs to send emails via SMTP or AWS SES, manage SMTP configurations, retrieve email logs, manage shop installations, or access shop/app data through Miso Apps services. |
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',
});
Send Email (User SMTP)
const result = await mailClient.sendEmail({
to: 'customer@example.com',
fromEmail: 'shop@example.com',
fromName: 'My Shop',
replyTo: ['support@example.com'],
subject: 'Hello!',
html: '<h1>Welcome!</h1>',
text: 'Welcome!',
});
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',
replyTo: ['support@example.com'],
subject: 'Hello!',
html: '<h1>Welcome!</h1>',
text: 'Welcome!',
});
Get Email Logs
const logs = await mailClient.getEmailLogs({
status: 'sent',
type: 'user',
page: 1,
limit: 20,
});
SMTP Configuration
const config = await mailClient.upsertSmtpConfig({
host: 'smtp.gmail.com',
port: 587,
secure: false,
username: 'user@gmail.com',
password: 'app-password',
});
const config = await mailClient.getSmtpConfig();
await mailClient.updateSmtpConfig({
port: 465,
secure: true,
isActive: true,
});
await mailClient.deleteSmtpConfig();
const result = await mailClient.testSmtpConnection();
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'
);
Install App
const result = await shopService.installApp({
shop: 'example.myshopify.com',
shopName: 'Example Shop',
contactEmail: 'contact@example.com',
themeId: 'theme-123',
app: {
appId: 'llmstxt',
plan: 'basic',
accessToken: 'token',
},
});
Uninstall App
const result = await shopService.uninstallApp({
shop: 'example.myshopify.com',
appId: 'llmstxt',
});
Get App
const { shop, app } = await shopService.getApp('example.myshopify.com', 'llmstxt');
Update App
const { shop, app } = await shopService.updateApp(
'example.myshopify.com',
'llmstxt',
{
plan: 'premium',
isReviewed: true,
accessToken: 'new-token',
}
);
Shop Queries
const { shop } = await shopService.getShop('example.myshopify.com');
const { apps } = await shopService.getShopApps('example.myshopify.com');
const { shops, total, page, pages } = await shopService.listShops({
page: 1,
limit: 10,
platform: 'shopify',
});
const { shops } = await shopService.findUninstalledShops('llmstxt');
const stats = await shopService.getStats();
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.