About the External Database Service Plugin

As an external database provider, you can integrate with Wix to allow a Wix sites to access and manage data stored anywhere, as if it were hosted natively on Wix.

The integration is done via an app in the Wix App Market and by implementing the External Database service plugin. After the app is installed on a site, Wix triggers a call to your service whenever the site needs to access and interact with the external database.

Using the service plugin, you can design your app to:

  • Make external business data available to Wix sites.
  • Make an external database available to Wix site owners to store their business data.

Managing data with Wix

Wix offers a variety of data management solutions to accommodate common user needs at different scales. This includes support for internal databases that are hosted directly on Wix, as well as external databases hosted outside the Wix ecosystem.

You can store and manage data directly on Wix using the Wix Data API. Wix also supports managing data hosted on external databases. The External Database Connections API allows Wix Data to communicate with an external database as if it were hosted directly on Wix. Wix offers several out-of-the-box external database integrations for common platforms such as Google Cloud Platform (GCP), Amazon Web Services (AWS), or Microsoft Azure. These integrations translate Wix Data requests into the external database's protocol, and translate the response back into a format that Wix APIs can read.

To allow Wix Data to communicate with any other data source, implement the External Database service plugin.

Terminology

  • Collection: A schema that determines the structure of data items to be stored. The schema defines the fields each item contains and the data type of each field.
  • Item: A single data entry in a collection.
  • External Database: A database hosted by an external service outside of Wix.
  • External Database Service Provider: A 3rd-party service that implements an interface to allow Wix Data to interact with an external database.

Get started

Follow these steps to begin implementing your service plugin.

Choose a framework

You can implement this service plugin with the following frameworks:

Configure your service plugin

To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can configure your plugin in the Wix Dev Center. For details, see External Database Extension Configuration.

Define handler functions

Use externalDatabase.provideHandlers() to define the following handler functions that implement your custom business logic. Make sure you define all required functions.

FunctionRequired
aggregateDataItems()No
countDataItems()No
createCollection()No
deleteCollection()No
getCapabilities()Yes
insertDataItemReferences()No
insertDataItems()No
listCollections()Yes
queryDataItems()Yes
queryDistinctValues()No
queryReferencedDataItems()No
removeDataItemReferences()No
removeDataItems()No
truncateDataItems()No
updateCollection()No
updateDataItems()No

Code examples

Below is an example for implementing the External Database service plugin in your code.

CLI: Basic code structure

This is the basic code structure for implementing the External Database service plugin with the Wix CLI:

Copy
1

Self-hosted: Basic code structure

This is the basic code structure for implementing a self-hosted External Database service plugin:

Copy
1

See also

Was this helpful?
Yes
No

Extension Config

To configure and customize your service plugin, you need to provide important details in the plugin.json configuration file.

Note

If you created your service plugin extension with the CLI, required fields are automatically populated for you.

Configuration Params
namespacestring

The namespace of the external database. This can be used to access collections within the database, for example namespace/collectionId.


uriConfigSpiBaseUri

The URI where the service provider is deployed.


Was this helpful?
Yes
No