This feature is in Developer Preview and is subject to change.
The data collections extension lets your app automatically create CMS data collections when it's installed on a site. You configure the collection schemas and optional initial data in a JSON configuration file. When a Wix user installs your app, the collections are automatically created in the site's CMS with the schemas and data you specified.
For the complete JSON schema and field definitions, see the data collections extension JSON reference.
It's important to note the following before using the data collections extension:
- The site that installs your app must have the CMS added. Without it, collections added by the extension won't appear after installation. You can bundle the CMS with your app by adding it as a dependency.
- This extension automatically enables the site's code editor, which is required for the Wix Data APIs to work. Without the extension, Wix users would need to manually enable the code editor on their site, which isn't guaranteed. With the extension, your app can reliably use Data APIs to read and write data in its collections.
- Blocks apps don't need this extension. If you're building a Blocks app, you can add collections directly in the Blocks editor. Learn more about CMS Collections in Blocks.
Use the data collections extension when your app needs to store data on a site for any reason. This includes:
- App-specific data storage: Store member preferences, app settings, cached data, or any other data your app needs to persist on the site.
- Content management: Pre-populate collections with templates, sample content, or starter data that helps Wix users get started with your app.
- Analytics and tracking: Store analytics data, events, or visitor activity logs that your app collects and manages.
- User-generated content: Create collections for visitor submissions, reviews, or custom content that your app helps Wix users manage.
You can add a data collections extension using:
- Wix CLI: Add and configure a data collections extension using the CLI.
- App dashboard configuration: Configure collections using the JSON editor in the app dashboard.
Changes to your data collections extension require releasing a new major version of your app. When a user updates to the new major version, their collections are updated as follows:
- Adding a new collection: The new collection is created on the site.
- Removing a collection: If the old app version defined a collection and the new version doesn't, the collection is removed from the site.
- Modifying a collection schema: Field additions, removals, and type changes are applied to the collection. Existing data is preserved.
When updating a data collections extension, keep these points in mind:
- Collection changes only affect users who update to the new major version. Users who don't update retain their current collections.
- Collection changes take up to 5 minutes to propagate after an update.
- Initial data is only imported when a collection is created. If a collection already contains data, initial data is ignored during updates.