Before you start: how the integration is shaped
Two facts that drive every step in this guide:- Your product catalog stays in Shopify. Hiveku doesn’t import products into your project. The scaffolded code reads products from Shopify’s Storefront API on every page render. Add a product in Shopify admin and it appears on your deployed site within seconds (after a webhook-driven cache bust).
- Hiveku owns the storefront UI. Pages, cart, components, JSON-LD SEO, customer-account screens, reviews moderation, subscriptions self-service — the AI agent scaffolds all of it as Next.js code into your project.
Step 1: Connect your Shopify store
Open Shopify settings in your Hiveku account
/dashboard/commerce/settings/shopify.The connection is account-level, not project-level — every project under that account can use it. Multi-shop accounts can connect more than one store.Click "Connect a store"
- Shop domain — your permanent
*.myshopify.comdomain (not your custom domain). Example:acme.myshopify.com. - OAuth app — picked from the apps your Hiveku admin registered. If you only have one, it’s preselected.
Authorize on Shopify
https://{shop}.myshopify.com/admin/oauth/authorize. Approve the requested scopes (read_products, write_products, read_orders, read_customers, read_themes, etc.).The popup closes automatically. Behind the scenes Hiveku exchanges the code for an Admin API token, mints a Storefront API token, encrypts both at rest, and registers webhook subscriptions for orders, products, subscriptions, and GDPR compliance topics.Verify the connection appears as Active
/dashboard/commerce/settings/shopify, your shop should now show with a green “Active” badge.client_id + client_secret under Settings → OAuth apps in Hiveku. This is a one-time setup per Hiveku account.Step 2: Pick the project that will host your storefront
You can either use an existing project or create a new one.- Existing Hiveku project
- New project
- Multi-shop agency
/dashboard/[projectId]/v3 (the v3 builder workspace). Your Shopify connection is automatically inherited at the account level — no per-project setup unless you want a different shop.Step 3: Ask the AI agent to scaffold the storefront
In the v3 builder chat, you can use any of these prompts (the agent recognizes the intent and picks the right tool):- “Build me a shop with my Shopify products.”
- “Add a product browsing page with cart and checkout.”
- “Set up an online store using my Shopify catalog.”
- “Make a complete shop — products, cart, customer account.”
What the agent does
Calls `shopify_status`
Calls `shopify_scaffold_compat_check`
- Router — App Router required. Pages Router projects are hard-blocked.
- Path alias — handles
@/*→./src/*(default Hiveku) AND@/*→./*(rewrites paths automatically). - Tailwind — required for the scaffolded components to render styled.
- Routing collisions — refuses to scaffold if existing dynamic routes would clash with templates.
compatible: true instantly. For an imported / ejected project, the agent surfaces any blockers and stops.Calls `shopify_scaffold_product_detail_route`
Edits your `app/layout.tsx`
needsLayoutWrapper: true because the cart context was newly written. The agent automatically edits your root layout to wrap children in <CartProvider><CartDrawer />{children}</CartProvider>.Without this wrapper, useCart() throws on first render. The agent does this surgery itself; you don’t need to touch the file.Step 4: Deploy and verify
Click Deploy in the v3 builder
SHOPIFY_SHOP_DOMAIN,SHOPIFY_API_VERSION,SHOPIFY_ADMIN_TOKEN(server-only)NEXT_PUBLIC_SHOPIFY_SHOP_DOMAIN,NEXT_PUBLIC_SHOPIFY_STOREFRONT_TOKEN,NEXT_PUBLIC_SHOPIFY_CONNECTION_IDNEXT_PUBLIC_SHOPIFY_CRO_*andNEXT_PUBLIC_SHOPIFY_SUBS_*(CRO + subscriptions config)
Visit your deployed `/products` route
Visit a product detail page at `/products/<handle>`
- Product title, description, price in the HTML
- A
<script type="application/ld+json">Product schema block - When reviews exist:
aggregateRatingpopulated inside that schema - A
BreadcrumbListJSON-LD block
Click 'Add to cart'
Step 5: Optional — Customer accounts (sign-in + order history)
Adds/account/login, /account/orders, profile, and addresses pages. Customer authentication uses Shopify’s Customer Account API (separate OAuth from your Admin connection — each shop owns its own auth).
Hard precondition
Your shop must have a Customer Account application registered in Shopify admin. Steps:In Shopify admin, go to Settings → Customer accounts
Register a Customer Account application
https://<your-fly-url>/account/auth/callback. For production: https://yourshop.com/account/auth/callback.Save the client_id
In Hiveku, set the Customer Account client_id on the connection
/dashboard/commerce/shopify → Connection settings → enter the client_id + redirect URI.Then ask the agent
Prompt:“Add customer account login and order history.”The agent calls
shopify_scaffold_customer_account and writes the /account/* scaffold. Sign-in buttons, order list, and profile pages all work after the next deploy.
Step 6: Optional — Subscriptions (subscribe & save)
The variant picker subscribe-vs-one-time toggle is already scaffolded in step 3. It self-disables when products have no selling plans, so it’s invisible until your shop is ready.Hard preconditions (operational, not Hiveku)
Turn on Shopify Payments
Install the Shopify Subscriptions app
product.sellingPlanGroups is empty everywhere and the storefront subscribe toggle stays hidden.Configure Selling Plans on your products
Add the customer-account self-service pages
shopify_scaffold_subscriptions which adds /account/subscriptions (list of contracts) and /account/subscriptions/[id] (pause / resume / cancel). Bundles the customer-account scaffold if you don’t already have it.Optional: tune subscription copy
/dashboard/commerce/settings/storefront for the subscriptions panel:- Picker heading (“Purchase options”)
- One-time vs Subscribe labels
- Default selection (one-time vs subscribe-first)
- Savings badge text
- Customer self-service toggle (off =
/account/subscriptionsreturns 404)
What shoppers experience
- See subscribe-vs-one-time radio + cadence dropdown on the PDP (auto-renders when selling plans exist).
- Cart line shows “Subscribe — every 30 days” badge.
- Checkout creates a Subscription Contract on Shopify’s side.
- Manage from
/account/subscriptions— pause / resume / cancel inline.
Workflow automations off subscription events
Five workflow trigger node types are now in the palette (workflow builder → “Add trigger”):Shopify: Subscription Started— anchor for thank-you / VIP-flaggingShopify: Subscription Paused— anchor for “we miss you” re-engagementShopify: Subscription Cancelled— anchor for win-back email sequencesShopify: Subscription Billing Failed— card-update reminder + ops alertShopify: Subscription Billing Succeeded— “your X is shipping” notifications
eventTypes, connectionId, minAmountCents, maxAmountCents.
Step 7: Optional — Reviews
The<ProductReviews/> component is already scaffolded in step 3. Reviews land in moderation queue at /dashboard/commerce/shopify/reviews. JSON-LD aggregateRating populates automatically when at least one review is approved.
Collecting reviews via workflow
Reviews aren’t auto-collected; you build a workflow that sends review-request emails after orders.In the workflow builder, create a new workflow
Shopify: Order Created trigger.Add a Wait node
Add a Send Email node
Moderating reviews
- Pending reviews land in
/dashboard/commerce/shopify/reviewswith star rating, customer email, product, body excerpt. - One-click Approve / Reject / Mark as Spam.
- Approved reviews go live and feed
aggregateRatingon the PDP. - 1- and 2-star reviews auto-seed an
urgentitem in the AI ops inbox so you don’t miss them.
Reward automations
Build workflows that fire onShopify: Review Approved with minRating: 5 to auto-send thank-you discounts to happy customers.
Step 8: Optional — Tune the storefront (CRO)
Visit/dashboard/commerce/settings/storefront for the conversion-rate panel. Five components are auto-included in your storefront and tunable per shop:
Step 9: Optional — Build automations off Shopify events
The workflow builder now has 12 Shopify trigger node types in the palette: Order events:- Shopify: Order (any event) — fires on create AND update
- Shopify: Order Created — anchor for thank-you / welcome / post-purchase upsells
- Shopify: Order Updated — refunds, partial fulfillment, address changes
- Shopify: Review (any event)
- Shopify: Review Submitted — alert ops on negative reviews (use
maxRating: 2) - Shopify: Review Approved — recommended for “thank-you discount on 5-star” automations
- Shopify: Subscription (any event)
- Shopify: Subscription Started
- Shopify: Subscription Paused
- Shopify: Subscription Cancelled — win-back sequences
- Shopify: Subscription Billing Failed — #1 churn signal; auto-send card-update reminder
- Shopify: Subscription Billing Succeeded
Step 10: Optional — Segment customers by Shopify activity
Every Shopify order auto-upserts the customer into your CRM with rollup fields:shopify_total_spent_cents(lifetime value)shopify_order_countshopify_first_order_atshopify_last_order_atshopify_first_order_id
/dashboard/marketing/email/audiences/new, the Shopify commerce filters section gives you:
- Order history — Has at least one Shopify order (buyers) / No Shopify orders yet (leads)
- Min/max lifetime spend — VIP segments (e.g. min $500)
- Min order count — repeat buyers (e.g. 2+)
- Last ordered after / before — recency windows
What Hiveku can’t do (set expectations correctly)
The integration deliberately keeps Shopify as the source of truth for the merchant catalog and operations. So:- ❌ Hiveku doesn’t manage products. Add, edit, delete in Shopify admin. (Exception: AI agent can create draft products via Admin API, gated on admin/owner role — but they stay drafts until you publish them in Shopify admin.)
- ❌ Hiveku doesn’t manage inventory. Quantities live in Shopify.
- ❌ Hiveku doesn’t manage orders. View / refund / fulfill in Shopify admin.
- ❌ Hiveku doesn’t manage shipping rates or taxes. Shopify owns these.
- ❌ Hiveku doesn’t process payments. Shopify Payments owns PCI; we never touch a card number.
- ❌ Hiveku doesn’t run the recurring-billing engine. Shopify Payments + Shopify Subscriptions charge customers on cadence; we render the storefront UI on top.
- ❌ Hiveku doesn’t bulk-import existing reviews from Yotpo / Loox / Stamped / Okendo. New reviews collected via Hiveku flow land in Hiveku Reviews; previously-collected ones stay where they are. Bulk-import CSV is roadmap.
- ❌ Hiveku doesn’t ship a Hydrogen storefront natively. It scaffolds Next.js. The
shopify_eject_manifesttool generates the migration plan to Hydrogen if you want to leave; the actual AST transform is roadmap. - ❌ Hiveku doesn’t change Shopify settings on your behalf. Customer Account API client config, payment-method enablement, taxes, shipping zones — all live in Shopify admin and you configure them there.
- ❌ Hiveku doesn’t bridge non-Shopify-Payments subscriptions. ReCharge / Bold / Smartrr / Skio are headless-incompatible with our scaffolds. They work only on Liquid themes.
- ❌ Hiveku doesn’t run on Pages Router. Storefronts require Next.js App Router.
shopify_scaffold_compat_checkwill hard-block a Pages Router project.
Apps that won’t work on a headless Hiveku storefront
If your shop has any of these installed, they won’t render on the Hiveku-built site. The AI agent’sshopify_admin_app_compat_check tool detects them and recommends Hiveku-native replacements:
Things to know about deployment
- Hot updates from Shopify — when you add or edit products, fire
products/create,products/update, orcollections/updatewebhooks reach Hiveku → Hiveku calls your deployed site’s/api/revalidate?tag=...&token=...→ Next.js invalidates the cache. New product appears within seconds. Zero code change, zero redeploy. - Cache-tag bust manually — if a product looks stale (rare), prompt the AI agent: “My catalog looks stale, please refresh.” It calls
shopify_admin_invalidate_cacheto force a bust. - Preview deploys (Fly) vs production / staging (ECS) — env-var injection happens for both. Preview URLs are full-featured.
- Disconnect — going back to
/dashboard/commerce/settings/shopifyand clicking Disconnect marks the connection inactive. The next deploy strips the Shopify env vars; the currently-running site keeps working until then.
Common pitfalls
Storefront says "No products" but my Shopify has products
Storefront says "No products" but my Shopify has products
NEXT_PUBLIC_SHOPIFY_STOREFRONT_TOKENnot set — your project hasn’t redeployed since you connected Shopify. Click Deploy.- Storefront API not enabled in your Shopify admin — Shopify admin → Apps → Develop apps → Configure Storefront API access.
- Wrong shop domain — verify
NEXT_PUBLIC_SHOPIFY_SHOP_DOMAINmatches what you OAuth’d into.
Cart drawer says "useCart must be used inside <CartProvider>"
Cart drawer says "useCart must be used inside <CartProvider>"
app/layout.tsx and confirm children are wrapped in <CartProvider><CartDrawer/>...</CartProvider>. If the AI agent didn’t add it, ask: “Wrap my root layout in CartProvider for the cart to work.”Customer account login throws CustomerNotConfiguredError
Customer account login throws CustomerNotConfiguredError
/dashboard/commerce/shopify → Connection settings → set the client_id + redirect URI from your Shopify admin.Review submission link from email returns "Invalid token"
Review submission link from email returns "Invalid token"
Routing collision when adding Shopify to an existing project
Routing collision when adding Shopify to an existing project
app/products/[slug]/page.tsx (different dynamic param name), Hiveku’s compat check blocks the scaffold. Either rename your existing route to [handle] or ask the agent to scaffold under app/shop/ instead.