Bc headless

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Bc headless is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Build headless commerce with BigCommerce — Catalyst (Next.js reference storefront), GraphQL Storefront API, server-side APIs, embedded checkout, and headless architecture patterns. Use when building decoupled storefronts or integrating BigCommerce as a headless backend.

How to use this skill

Skill file

BigCommerce Headless Commerce

Before writing code

Fetch live docs:

  1. Fetch https://www.catalyst.dev/ for Catalyst documentation
  2. Web-search site:developer.bigcommerce.com headless for headless guide
  3. Web-search site:github.com bigcommerce catalyst for Catalyst source and examples

Headless Architecture

What Headless Means for BigCommerce

Decouple the frontend from BigCommerce:

Why Headless

Catalyst

What It Is

BigCommerce's official Next.js reference storefront:

Getting Started

npx create-catalyst-storefront@latest my-store

Prompts for:

Project Structure

my-store/
├── app/                     # Next.js App Router pages
│   ├── (default)/           # Default locale group
│   │   ├── page.tsx         # Homepage
│   │   ├── product/         # Product pages
│   │   ├── category/        # Category pages
│   │   ├── cart/            # Cart page
│   │   └── account/         # Customer account
│   └── layout.tsx           # Root layout
├── client/                  # BigCommerce API client
│   ├── queries/             # GraphQL queries
│   └── mutations/           # GraphQL mutations
├── components/              # React components
├── lib/                     # Utilities
├── public/                  # Static assets
├── .env.local               # Environment variables
├── next.config.js           # Next.js config
├── tailwind.config.js       # Tailwind config
└── package.json

Key Environment Variables

BIGCOMMERCE_STORE_HASH=your_store_hash
BIGCOMMERCE_ACCESS_TOKEN=your_access_token
BIGCOMMERCE_CHANNEL_ID=1
BIGCOMMERCE_STOREFRONT_TOKEN=your_storefront_token
BIGCOMMERCE_CUSTOMER_IMPERSONATION_TOKEN=your_token

Data Fetching Patterns

Server Components (Recommended)

Fetch data in Next.js Server Components using the GraphQL client:

// app/product/[slug]/page.tsx
async function ProductPage({ params }: { params: { slug: string } }) {
  const product = await getProduct({ path: `/${params.slug}` });
  return <ProductDetail product={product} />;
}

Client-Side Fetching

For interactive features (cart, search-as-you-type):

Caching Strategy

Checkout in Headless

Embedded Checkout (Recommended)

Embed BigCommerce's checkout in your headless site:

  1. Create cart via API → get redirect_urls.checkout_url
  2. Embed using @bigcommerce/checkout-sdk embedCheckout()
  3. BigCommerce handles payment processing (no PCI scope)

Custom Checkout

Full API-driven checkout:

  1. Cart API → Checkout API → Orders API → Payments API
  2. Requires your own checkout UI
  3. Payment processing via Payments API (PCI implications if handling raw card data)
  4. Use tokenized payment methods to reduce PCI scope

Authentication in Headless

Customer Login

Session Management

Integration with Other Services

Composable Commerce Stack

BigCommerce + headless enables composable architecture:

Best Practices

Fetch the Catalyst documentation and BigCommerce headless guide for exact setup steps, GraphQL queries, and current best practices before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.