To integrate AWS AppSync in your OutSystems app, simply follow these steps:
Preparation of AWS AppSync
Please configure the AppSync GraphQL API if you have not done so yet. If you are not familiar with AppSync, you can find more information in the AWS documentation. Open the AWS AppSync console and look up the following connection parameters in the "Settings" area, as you will need them to configure the connector.
For now, the connector only supports API key for authentication. You should consider further securing the endpoint using WAF.
Install the AWS AppSync Connector
Install this AWS AppSync Connector from the Forge to your OutSystems environment.
Client-Side
For the client-side implementation, you need to add a dependency to the AWSAppSyncClient widget.
Place the AWSAppSyncClient block onto the screen where you want to use real-time communication an configure the connection via the provided input parameters:
To react on status changes and incoming messages, add handler actions for the following events the block exposes:
To interact with the AWSAppSyncClient there are several client actions. To identify the block you want to address, you need to pass the SubscriberId as input parameter:
Server-Side
For the server-side implementation, you only need to add a dependency to the server action AWSAppSync_SendGraphQLRequest: