These sample flows illustrate how to establish an external database connection in different ways. They can be helpful jumping-off points as you plan your implementation.
Wix offers several out-of-the-box external database adaptors for common platforms. Deploying an out-of-the-box adaptor is a quick way to integrate an external database with a site. To do this:
Set up the external database adaptor for the platform hosting the external database.
Call the Create External Database Connection method and specify the connection's name, the endpoint by which it can be accessed, and any additional configuration details. For connectionType
, specify STANDALONE
. For example:
The method returns the following response:
You can now access the external database in the CMS and using Wix Data APIs.
You can also build and deploy your own adaptor to integrate an external database directly with a site:
Implement the endpoints for the External Database REST Service Plugin and expose them on a public, https
base URL. For example:
Note: You can make your adaptor available for integration with one or more sites by creating a Wix app. If you create an app, you can skip the remaining steps.
Call the Create External Database Connection method and specify the connection's name. For the connectionType
property, specify WIX_SERVICE_PLUGIN
. For example:
The connection is set up with a connectionStatus.successful
status of false
. For example:
Use the publicKey
in the response to configure your service to verify that the requests it receives are coming from Wix.
To finish setting up the connection, call the Update External Database Connection method with the same name used when creating the connection. In the externalDatabaseConnection
parameter, specify the endpoint by which the service can be accessed. For example:
The method returns the following response:
You can now now access the external database in the CMS and using Wix Data APIs.