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.
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:
- Call
initializeonce when the page/app starts. - Pull CMS content by collection and key when the page needs editable copy, blocks, forms, media, or localization.
- Add commerce or bookings only when the business flow needs products, carts, services, providers, availability, quote, or checkout.
- Track important actions with action keys such as
page.view,lead.submitted,product.viewed,checkout.started, orbooking.requested. - Connect forms, orders, bookings, and support events to workflows when the client needs follow-up.
Core Modules
| Module | Use it for |
|---|---|
| CMS | Pages, blocks, media, forms, taxonomies, and localization |
| Commerce | Products, variants, carts, promo codes, orders, payments, checkout |
| Bookings | Services, providers, availability, scheduled cart lines |
| Forms | Lead capture, intake, quote requests, support requests |
| Contacts | Anonymous and known visitor/customer context |
| Action | First-party event keys for analytics, timelines, goals, and reporting |
| Support | Conversations, chat widget, human handoff, support context |
| Workflows | Scheduled jobs, event triggers, webhooks, follow-up automation |
| API & SDK | Framework-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
- Quick Start for the minimal setup.
- Core Concepts for the domain model.
- Content Website for CMS-driven pages.
- E-commerce Store for products, carts, quote, and checkout.
- Action Keys and Experiment Goals for measurement and variant goals.