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:
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.
Follow these steps to begin implementing your service plugin.
You can implement this service plugin with the following frameworks:
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.
Use externalDatabase.provideHandlers()
to define the following handler functions that implement your custom business logic. Make sure you define all required functions.
Below is an example for implementing the External Database service plugin in your code.
This is the basic code structure for implementing the External Database service plugin with the Wix CLI:
1
This is the basic code structure for implementing a self-hosted External Database service plugin:
1
To configure and customize your service plugin, you need to provide important details in the plugin.json
configuration file.
If you created your service plugin extension with the CLI, required fields are automatically populated for you.
The namespace of the external database. This can be used to access collections within the database, for example namespace/collectionId.
The URI where the service provider is deployed.