commerce-app-storage

Installation
SKILL.md

Add Database Storage to a Commerce App

Integrates App Builder Database Storage into an existing Commerce app and scaffolds a runtime action that uses @adobe/aio-lib-db to read and write documents. The library is MongoDB-like: data lives in collections of documents, queried with familiar filters.

The db-access code is identical regardless of action type — what differs is how the action is registered and what its handler returns:

  • Web action — HTTP-invokable (web: "yes"); returns a response built with the responses helpers from @adobe/aio-commerce-lib-core.
  • Event/webhook action — invoked by a Commerce event or webhook; referenced from app.commerce.config.ts via commerce-app-eventing (runtimeActions) or commerce-app-webhooks (runtimeAction).

Prerequisites

  • Verify the app is scaffolded and initialized, not merely that the config exists. Require both:
    • app.commerce.config.ts present in the project root, and
    • the project initialized — signalled by the generated src/commerce-extensibility-1/ directory and installed node_modules (the @adobe/aio-commerce-lib-app dependency).
  • If app.commerce.config.ts is missing, stop and invoke commerce-app-init first (it writes the config, then runs init).
  • If the config is present but the project is not initialized (no src/commerce-extensibility-1/ or node_modules), run npx @adobe/aio-commerce-lib-app init before continuing. Init is idempotent — it finds the existing config, skips the interactive prompts, installs dependencies, and generates the project files.
  • Actions and custom installation scripts can be authored in TypeScript only once the project has the TypeScript build setup (webpack-config.cjs + root tsconfig.json) that init scaffolds for a TypeScript Commerce config — see commerce-app-init. Otherwise, author them in JavaScript.
  • The App Builder Data Services API (API code AppBuilderDataServicesSDK) must be added to the project in the Adobe Developer Console — in every workspace that uses the database (no special license beyond App Builder). Without it, runtime actions cannot authenticate to the database service.
Installs
56
GitHub Stars
13
First Seen
Jun 4, 2026
commerce-app-storage — adobe/aio-commerce-sdk