Back to Arky

Arky Docs

Implementation docs for using Arky as the backend under custom websites.

Arky is a backend for a custom website. The frontend can be Astro, Svelte, React, Vue, plain TypeScript, or an agent-generated storefront. Arky provides the Admin, data model, storefront APIs, SDK helpers, and operational modules for the website.

Build From This Mental Model

Keep the website custom. Put repeat backend work in Arky: CMS, commerce, bookings, forms, contacts, action, support, workflows, admin, API, and SDK.

The Storefront Contract

Every storefront setup follows the same shape:

import { initialize } from "arky-sdk/storefront";

export const arky = initialize({
  baseUrl: "https://api.arky.io",
  storeId: "your-store-id",
  locale: "en",
  market: "us",
});

await arky.action.track({
  key: "page.view",
  payload: { path: location.pathname },
});

const cart = await arky.eshop.cart.load();

After initialize, use only the modules the website needs. A content site might use cms, forms, and action. A storefront might add eshop.cart, eshop.product, promo codes, checkout, and support. A service business might use CMS, bookings, scheduled cart lines, forms, and workflows.

Agent Build Order

Use this order when building or generating a site:

  1. Call initialize once when the page/app starts.
  2. Pull CMS content by collection and key when the page needs editable copy, blocks, forms, media, or localization.
  3. Add commerce or bookings only when the business flow needs products, carts, services, providers, availability, quote, or checkout.
  4. Track important actions with action keys such as page.view, lead.submitted, product.viewed, checkout.started, or booking.requested.
  5. Connect forms, orders, bookings, and support events to workflows when the client needs follow-up.

Core Modules

ModuleUse it for
CMSPages, blocks, media, forms, taxonomies, and localization
CommerceProducts, variants, carts, promo codes, orders, payments, checkout
BookingsServices, providers, availability, scheduled cart lines
FormsLead capture, intake, quote requests, support requests
ContactsAnonymous and known visitor/customer context
ActionFirst-party event keys for analytics, timelines, goals, and reporting
SupportConversations, chat widget, human handoff, support context
WorkflowsScheduled jobs, event triggers, webhooks, follow-up automation
API & SDKFramework-agnostic storefront and admin access

Common Starting Points

Content website

const page = await arky.cms.entry.get({
  collection_id: "pages",
  key: "homepage",
  locale: "en",
});

Product storefront

const { items: products } = await arky.eshop.product.list({ limit: 20 });
await arky.eshop.cart.addProduct(products[0], products[0].variants[0], 1);
const quote = await arky.eshop.cart.quote();

Service booking

const { items: services } = await arky.eshop.service.list({});

await arky.eshop.service.initialize();
await arky.eshop.service.select(services[0]);
await arky.eshop.service.findFirstAvailable();

Action key

await arky.action.track({
  key: "lead.submitted",
  payload: { source: "homepage" },
});

Next