Setup

To use the Collections API, install the @wix/stores package using npm or Yarn:

Copy
1
npm install @wix/stores

or

Copy
1
yarn add @wix/stores

Then import { collections } from @wix/stores:

Copy
1
import { collections } from '@wix/stores'
Was this helpful?
Yes
No

getCollection( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a collection with the provided ID.

Copy
function getCollection(_id: string): Promise<Collection>
Method Parameters
_idstringRequired
Requested collection ID.
Returns
Return Type:Promise<Collection>
Was this helpful?
Yes
No

getCollectionBySlug( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a collection with the provided slug.

Copy
function getCollectionBySlug(slug: string): Promise<GetCollectionBySlugResponse>
Method Parameters
slugstringRequired
Slug of the collection to retrieve.
Returns
Return Type:Promise<GetCollectionBySlugResponse>
Was this helpful?
Yes
No

queryCollections( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering. See Stores Pagination for more information.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
nameeq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
Copy
function queryCollections(): CollectionsQueryBuilder
Request
This method does not take any parameters
Returns
Was this helpful?
Yes
No