🎯

shopify-metafields

🎯Skill

from toilahuongg/shopify-agents-kit

VibeIndex|
What it does

Manages and manipulates Shopify metafields, enabling custom data storage and retrieval across products, orders, and resources via Liquid and GraphQL.

πŸ“¦

Part of

toilahuongg/shopify-agents-kit(35 items)

shopify-metafields

Installation

npm installInstall npm package
npm install -g shopify-cc-kit
npm installInstall npm package
npm install shopify-cc-kit
πŸ“– Extracted from docs: toilahuongg/shopify-agents-kit
1Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Guide for working with Shopify Metafields. Covers definitions, storing custom data, accessing via Liquid, and GraphQL mutations.

Overview

# Shopify Metafields

Metafields allow you to store additional data on Shopify resources (Products, Orders, Customers, Shops) that aren't included in the default schema (e.g., "washing instructions" for a product).

1. Concepts

  • Namespace: Grouping folder (e.g., my_app, global).
  • Key: Specific field name (e.g., washing_instructions).
  • Type: Data type (e.g., single_line_text_field, number_integer, json).
  • Owner: The resource attaching the data (Product ID, Shop ID).

2. Metafield Definitions (Standard)

Always use Metafield Definitions (pinned metafields) when possible. This integrates them into the Admin UI and ensures standard processing.

  • Create: Settings > Custom Data > [Resource] > Add definition.
  • Access: namespace.key

3. Accessing in Liquid

To display metafield data on the Storefront:

```liquid

Washing: {{ product.metafields.my_app.washing_instructions }}

{% assign file = product.metafields.my_app.size_chart.value %}

{% if product.metafields.my_app.instructions != blank %}

...

{% endif %}

```

4. Reading via API (GraphQL)

```graphql

query {

product(id: "gid://shopify/Product/123") {

title

metafield(namespace: "my_app", key: "instructions") {

value

type

}

}

}

```

5. Writing via API (GraphQL)

To create or update a metafield, use metafieldsSet.

```graphql

mutation metafieldsSet($metafields: [MetafieldsSetInput!]!) {

metafieldsSet(metafields: $metafields) {

metafields {

id

namespace

key

value

}

userErrors {

field

message

}

}

}

/ Variables /

{

"metafields": [

{

"ownerId": "gid://shopify/Product/123",

"namespace": "my_app",

"key": "instructions",

"type": "single_line_text_field",

"value": "Wash cold, tumble dry."

}

]

}

```

6. Private Metafields

If you want data to be hidden from other apps and the storefront, use Private Metafields. Note: These cannot be accessed via Liquid directly.

  • Use privateMetafield queries/mutations.
  • Requires explicit read_private_metafields / write_private_metafields scope (rarely used now, app_data metafields are preferred for app-specific valid storage).

More from this repository10

🎯
shopify-polaris-icons🎯Skill

Provides comprehensive guidance and examples for integrating and using Shopify Polaris Icons in commerce applications with accessibility and semantic color tones.

🎯
shopify-polaris-viz🎯Skill

Generates accessible, Shopify Admin-styled data visualizations using Polaris Viz library for React applications.

🎯
shopify-polaris-design🎯Skill

Generates Shopify Polaris-styled React components and design elements for creating consistent and professional e-commerce interfaces.

🎯
threejs-loaders🎯Skill

Loads and manages 3D assets in Three.js, handling GLTF models, textures, and environments with comprehensive loading progress tracking.

🎯
brainstorm🎯Skill

Guides users through creative brainstorming by applying structured techniques like SCAMPER and Design Thinking to generate innovative solutions.

🎯
threejs-animation🎯Skill

Enables precise and flexible object animations in Three.js, supporting keyframe, skeletal, and procedural motion with advanced blending and playback control.

🎯
shopify-webhooks🎯Skill

Handles Shopify webhook verification, processing, and registration for real-time event synchronization with secure HMAC authentication.

🎯
shopify-extensions🎯Skill

Guides developers through building and integrating Shopify Extensions across Admin, Checkout, Theme, and Post-purchase interfaces using latest CLI and APIs.

🎯
design🎯Skill

Generates design-related tasks and recommendations for Shopify store aesthetics, layout, and visual branding using AI-powered analysis.

🎯
algorithmic-art🎯Skill

Generates algorithmic art philosophies and p5.js code sketches using computational aesthetics, seeded randomness, and generative design principles.