/shopify-commerce:shopify-securityfrom shopify-commerce
Secures Shopify apps with HMAC webhook verification, session token validation, OAuth scoping, CSP, GDPR webhooks, and input validation.
Ships in shopify-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
site:shopify.dev security best practices for security guidelinessite:shopify.dev webhook verification hmac for HMAC implementationsite:shopify.dev session token for session token verificationEvery webhook includes X-Shopify-Hmac-SHA256:
import crypto from 'crypto';
function verifyShopifyWebhook(
rawBody: Buffer,
hmacHeader: string,
secret: string,
): boolean {
const calculated = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('base64');
return crypto.timingSafeEqual(
Buffer.from(calculated),
Buffer.from(hmacHeader),
);
}
Critical: Use timingSafeEqual to prevent timing attacks. Use raw body buffer, not parsed JSON.
For embedded apps using App Bridge:
import jwt from 'jsonwebtoken';
function verifySessionToken(token: string, apiSecret: string) {
const decoded = jwt.verify(token, apiSecret, {
algorithms: ['HS256'],
});
// Verify issuer is a valid Shopify shop
const iss = decoded.iss as string;
if (!iss.match(/^https:\/\/[a-zA-Z0-9-]+\.myshopify\.com\/admin$/)) {
throw new Error('Invalid issuer');
}
return decoded;
}
Session token claims:
iss — shop admin URLdest — shop URLsub — user IDexp — expiration (1 minute)nbf — not beforeiat — issued atjti — unique token IDVerify the access token has expected scopes:
For embedded apps in Shopify admin:
eval(), no external fonts without proper headersframe-ancestors header for iframe embedding:
Content-Security-Policy: frame-ancestors https://*.myshopify.com https://admin.shopify.com;
Every app MUST implement:
customers/data_request — respond within 30 days with customer datacustomers/redact — delete customer data within 30 daysshop/redact — delete ALL store data within 48 hours of uninstallFailing to implement these results in app rejection.
| escape filter to user-generated content| json filter for embedding data in JavaScriptcustomer data without escapinguserErrors in mutation responses.env files locally (excluded from version control)timingSafeEqual for all secret comparisonsnpm audit regularlyFetch the Shopify security documentation for exact HMAC implementation, session token structure, and CSP requirements before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin shopify-commerce23 skills in this plugin
/js-modernWrite modern JavaScript and TypeScript — ES6+ features, async/await, modules, destructuring, optional chaining, TypeScript types, and modern tooling. Use when writing JavaScript/TypeScript for Shopify themes, apps, Functions, or Hydrogen storefronts./node-backendBuild Node.js backends for Shopify apps — Remix server, @shopify/shopify-app-remix, session storage, OAuth handling, API proxy, webhook processing, and deployment. Use when building the server-side component of Shopify apps./react-patternsBuild React applications with Remix — loaders, actions, hooks, Server/Client Components, nested routes, error boundaries, form handling, and streaming SSR. Use when building Shopify Hydrogen storefronts or Remix-based apps./shopify-agentic-ucpIntegrate Shopify UCP discovery, agent profiles, catalog/cart tools, and checkout handoff using the merchant's current schemas and trust tier./shopify-api-graphqlUse Shopify GraphQL APIs — Admin API for server-side CRUD, Storefront API for client-side queries, versioning, cost-based rate limiting, bulk operations, pagination. Use when integrating with Shopify data./shopify-api-restMIGRATION SKILL: Shopify REST Admin API — endpoint patterns, authentication, rate limits, and REST-to-GraphQL migration guide. The REST Admin API is deprecated (October 2024). Use this skill only for maintaining legacy integrations or planning migration to GraphQL.Other plugins' skills for the same job