Skip to content
Skillv1.0.0

snipcart

Add e-commerce to any website with Snipcart. Use when a user asks to add a shopping cart to a static site, sell products from a JAMstack site, add buy buttons to any HTML page, or integrate e-commerce

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/snipcart/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill snipcart. Copyright stays with the author (Apache-2.0).

Snipcart

Overview

Snipcart adds a full shopping cart to any website with just HTML attributes. No backend needed — it works with static sites, JAMstack, and any HTML page. Handles checkout, payments, shipping, taxes, and inventory.

Instructions

Step 1: Add to Any Page

<!-- Add Snipcart scripts to your page -->
<link rel="stylesheet" href="https://cdn.snipcart.com/themes/v3.4.1/default/snipcart.css" />
<script async src="https://cdn.snipcart.com/themes/v3.4.1/default/snipcart.js"></script>
<div hidden id="snipcart" data-api-key="YOUR_PUBLIC_API_KEY"></div>

<!-- Product buy button — just HTML attributes -->
<button class="snipcart-add-item"
  data-item-id="tshirt-001"
  data-item-name="Premium T-Shirt"
  data-item-price="29.99"
  data-item-url="/products/tshirt"
  data-item-image="/images/tshirt.jpg"
  data-item-description="100% organic cotton"
  data-item-custom1-name="Size"
  data-item-custom1-options="S|M|L|XL">
  Add to Cart — $29.99
</button>

<!-- Cart summary button -->
<button class="snipcart-checkout">
  Cart (<span class="snipcart-items-count">0</span>)
</button>

Step 2: Astro/Next.js Integration

---
// components/ProductCard.astro — Product card for static site
const { product } = Astro.props
---
<div class="product-card">
  <img src={product.image} alt={product.name} />
  <h3>{product.name}</h3>
  <p class="price">${product.price}</p>
  <button class="snipcart-add-item"
    data-item-id={product.id}
    data-item-name={product.name}
    data-item-price={product.price}
    data-item-url={`/products/${product.slug}`}
    data-item-image={product.image}>
    Add to Cart
  </button>
</div>

Step 3: JavaScript API

// Customize cart behavior with Snipcart JS API
document.addEventListener('snipcart.ready', () => {
  Snipcart.api.cart.items.added((item) => {
    console.log('Item added:', item.name)
    // Track in analytics
  })

  Snipcart.api.cart.confirmed((order) => {
    console.log('Order confirmed:', order.token)
    // Send to CRM, trigger email, etc.
  })
})

Guidelines

  • Snipcart takes 2% transaction fee + payment processor fees. No monthly fee.
  • Products are validated against your HTML — Snipcart crawls the product URL to verify prices.
  • Works with any SSG (Astro, Hugo, 11ty, Gatsby) — perfect for JAMstack e-commerce.
  • Supports subscriptions, digital products, and multi-currency.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-snipcart/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-snipcart.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-snipcart",
  "kind": "skill",
  "name": "snipcart",
  "description": "Add e-commerce to any website with Snipcart. Use when a user asks to add a shopping cart to a static site, sell products from a JAMstack site, add buy buttons to any HTML page, or integrate e-commerce without a backend.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "snipcart",
      "ecommerce",
      "cart",
      "jamstack",
      "static-site",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Add e-commerce to any website with Snipcart. Use when a user asks to add a shopping cart to a static site, sell products from a JAMstack site, add buy buttons to any HTML page, or integrate e-commerce without a backend."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/snipcart/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/snipcart/SKILL.md",
      "key": "terminalskills/skills/skills/snipcart/SKILL.md"
    },
    "compatibility": "Any HTML website, JAMstack, static sites",
    "license": "Apache-2.0"
  },
  "instructions": "# Snipcart\n\n## Overview\n\nSnipcart adds a full shopping cart to any website with just HTML attributes. No backend needed — it works with static sites, JAMstack, and any HTML page. Handles checkout, payments, shipping, taxes, and inventory.\n\n## Instructions\n\n### Step 1: Add to Any Page\n\n```html\n<!-- Add Snipcart scripts to your page -->\n<link rel=\"stylesheet\" href=\"https://cdn.snipcart.com/themes/v3.4.1/default/snipcart.css\" />\n<script async src=\"https://cdn.snipcart.com/themes/v3.4.1/default/snipcart.js\"></script>\n<div hidden id=\"snipcart\" data-api-key=\"YOUR_PUBLIC_API_KEY\"></div>\n\n<!-- Product",
  "cost": {
    "context_tokens": 603
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-snipcart/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.