# Connections

In Zingy, Connections serve as bridges for your app to communicate with external entities like third-party applications, proprietary databases, and various other services.

Your app's connections can be managed through the Connections tab as shown below (use the Toolbox menu and choose the Connections option).

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FliN5UPQMhtUtOi1EZHE2%2Fimage.png?alt=media&#x26;token=a7a0c393-d8ea-41ea-bb09-504ac272be63" alt=""><figcaption><p>Zingy App Editor - Connections tab</p></figcaption></figure>

***

## Adding a Connection

Use the :heavy\_plus\_sign:**`Add Connection`** icon to create a new connection for your app.

### Select the Service

The first step in creating a connection is to select the specific service you want to communicate with. Click [here](https://docs.zingy.ai/app-editor/connections/services) for a list of supported services.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FKvSVlbd4Uq6vrXUpBV5s%2Fimage.png?alt=media&#x26;token=dc8aef58-3535-417a-8c3f-495df5b68c5f" alt="" width="563"><figcaption><p>New Connection: Service selection</p></figcaption></figure></div>

### Select the Service Profile

A service can have one or more profiles. Each profile contains settings that distinctly recognize your account with that service. Additionally, the profile may have configuration options related to the service.

As part of the step 2, select an existing profile or select **`-New Profile-`** to create one.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FdXSOOmO7B2R8N95ttf1i%2Fimage.png?alt=media&#x26;token=4d3478ac-f2a6-45c3-9dc9-225e4b2722dd" alt="" width="563"><figcaption><p>New Connection: Service Profile selection</p></figcaption></figure></div>

When setting up a new service profile, the configuration options vary depending on the service. Please refer to the documentation section of the [specific service](https://docs.zingy.ai/app-editor/connections/services) to learn more.

You may also delete a service profile by selecting it and clicking on :heavy\_minus\_sign:icon that appears next to the selection dropdown.

{% hint style="success" %}
NOTE: All profile settings are encrypted and stored in Zingy's cloud infrastructure.
{% endhint %}

### Configure connection specific options

You will be taken to step 3, if the service offers connection specific configuration options. Please refer to the documentation section of the [specific service](https://docs.zingy.ai/app-editor/connections/services) to learn more.

{% hint style="warning" %}
Please note that you need to [re-publish your app](https://docs.zingy.ai/app-editor/publishing-your-app) for the connection to be available in the live version of your app.
{% endhint %}

***

## Using the Connection

### Operation/Commands

A service may offer one or more *operations*/*commands*. When invoked or triggered, these commands carry out specific tasks related to the service.

e.g. The [Stripe payments service](https://docs.zingy.ai/app-editor/connections/services/stripe), provides the *Initiate Payments* command that sets up the ability to accept payments inside your app.

Please refer to the documentation section of the [specific service](https://docs.zingy.ai/app-editor/connections/services) to learn about the operation commands they offer.

### Page Flow and Cloud Flow

The [Execute Connection Command](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/execute-connection-command) and [Execute API Call](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/execute-api-call) blocks are available in both [Page Flow](https://docs.zingy.ai/app-editor/page-flow) and [Cloud Flow](https://docs.zingy.ai/app-editor/cloud-flow). Using these blocks you can add logic to trigger the operations/commands supported by a service.

### Widget Elements

For some services, there are [widget elements](https://docs.zingy.ai/dynamic-content#widget-elements) in the [Page Element Library](https://docs.zingy.ai/page-editor/page-editor-tour#page-element-library) that can be added to pages and forms.

***

## Editing a Connection

To modify a connection, click on it and select the Edit option from the popup-menu.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FKKRO3jO3jmlNz8DZYGEN%2Fimage.png?alt=media&#x26;token=e7b256f7-2cc5-4627-bda4-f9da5c420b44" alt="" width="360"><figcaption><p>Connection: Edit option</p></figcaption></figure></div>

The following modifications are allowed on an existing connection:

* Choose a different service profile
* Modification of connection specific options (if the service offers that).

{% hint style="warning" %}
Please note that you need to [re-publish your app](https://docs.zingy.ai/app-editor/publishing-your-app) for the modifications to take effect in the live version of your app.
{% endhint %}

***

## Access (Security)

Similar to the access rules for [pages](https://docs.zingy.ai/page-settings#access-security) and [databases](https://docs.zingy.ai/data/database-tables#access-security-rules), you can define role based access to your app's connections for every operation/command offered by the service.

Click on the connection and choose the Access (Security) option from the popup-menu.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FMd5BDkM5Rzc2h4HKBtfg%2Fimage.png?alt=media&#x26;token=64637705-b753-4e29-a463-80b9745daaa8" alt="" width="346"><figcaption><p>Connection: Access (Security) option</p></figcaption></figure></div>

By default all registered [Users](https://docs.zingy.ai/app-editor/app-users) of the app and members of the Admin [group](https://docs.zingy.ai/app-editor/app-user-groups) are allowed to invoke all available operations/commands for the connection's service. You can change this by clicking on the Edit button (highlighted below) for the desired operation/command.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FbNWElJePnR2hCVQS1O1i%2Fimage.png?alt=media&#x26;token=f24d32a9-d875-49bb-af50-22a563d00b53" alt=""><figcaption><p>Connection: Access rules edit button</p></figcaption></figure>

The image below shows the process of editing the access rules.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FfeoVBvJSo6gt4q86jPeh%2Fimage.png?alt=media&#x26;token=ff345f46-2705-4684-b02a-d99f8b2819cc" alt=""><figcaption><p>Access Rules modification showing group selection <mark style="color:red;"><strong>(1)</strong></mark>, role selection <mark style="color:red;"><strong>(2)</strong></mark>, group add button <mark style="color:red;"><strong>(3)</strong></mark> and the group delete icon <mark style="color:red;"><strong>(4)</strong></mark>.</p></figcaption></figure>

* To allow a [group](https://docs.zingy.ai/app-editor/app-user-groups), select it <mark style="color:red;">**(1)**</mark>, choose the minimum role level <mark style="color:red;">**(2)**</mark> and click on the Add button <mark style="color:red;">**(3)**</mark>.&#x20;
* To grant public access to an operation, select the "Public" group.
* To remove a group click on the 'x' icon <mark style="color:red;">**(4)**</mark>. Note: The "Admin" group cannot be removed.

{% hint style="warning" %}
Please note that you need to [re-publish your app](https://docs.zingy.ai/app-editor/publishing-your-app) for the access changes to take effect in the live version of your app.
{% endhint %}

***

## Deleting a Connection

To delete a connection, click on it and select the Delete option from the popup-menu.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FtqEEna5qL00jIysyhAwm%2Fimage.png?alt=media&#x26;token=f298ebc5-3ddd-4b2e-b4c1-3e31e84cab73" alt="" width="320"><figcaption><p>Connection: Delete option</p></figcaption></figure></div>

{% hint style="warning" %}
Please note that you need to [re-publish your app](https://docs.zingy.ai/app-editor/publishing-your-app) for the connection to be removed in the live version of your app.
{% endhint %}
