Section collections
Section collections group custom sections into reusable, distributable packages. They bundle multiple sections with metadata (name, description, cover image) so they can be offered as a set in the Instant Site Editor.
Creating a Collection
Use the CLI to scaffold a new collection:
crane init --collection <name>This creates the directory structure under collections/. The command fails if a collection with that name already exists.
Folder Structure
collections/
├── assets/ # Shared assets (cover images)
│ └── collection_cover_image.png
└── <collection-name>/
└── configuration.ts # Collection descriptorConfiguration
The configuration.ts file defines the collection's metadata and the sections it includes.
Factory Functions
The @lightspeed/crane-api package exports the following factory functions used in configuration files:
collection.configuration()
Creates a collection configuration object with full type safety. Accepts metadata, and sections properties.
section.custom()
Creates a custom section referencing your own section implementation. Sets type to 'custom' automatically.
Properties
Metadata Properties
metadata.name
string
Yes
Display name (2–60 characters)
metadata.description
string
Yes
Description text (2–150 characters)
metadata.cover_image
ImageData
Yes
Cover image with set containing at least one resolution
metadata.preview_url
string
No
Preview URL for the collection
metadata.categories
string[]
No
Template categories (unique values, see below)
Template Categories
Available values for metadata.categories:
apparel_footwearvape_smokehome_gardensport_outdoorjewelry_accessoriespet_animalsbikeshealth_beautygift_shopelectronicsother
Sections
The sections array defines which custom sections are included in the collection. Each entry references a section from your sections/ directory.
Section Properties
type
'custom'
Yes
Always 'custom'
id
string
Yes
Section ID (must exist in the sections/ directory)
category
string
No
Section category for classification in the editor
Section Categories
Available values for the category field:
COVER, ANNOUNCEMENT, STORE, SLIDER, VIDEO, SPECIAL_OFFER, CUSTOMER_REVIEW, COMPANY_INFO, SHIPPING_PAYMENT, LOCATION, COLLECTIONS, BRANDS, CONTACT_INFO
Example
Build and Deploy
Collections are built and deployed alongside sections and templates — no additional commands needed:
Last updated
Was this helpful?
