Layer Integration Template

Building a new integration from scratch can get pretty complicated. A good starting point would is integration-template project, which has the necessary project structure and boilerplate code to get you started. It contains both Amazon AWS and Microsoft Azure cloud provider implementations.

The template implements a simple backend service which listens for all messages that are sent in the Layer application and fetches the sender full identity via API. This implementation is for demonstration purposes only.

Setup

Clone the project to you local machine

git clone git@github.com:layerhq/integration-template.git

Pick your cloud provider aws or azure by navigating into the folder.

Deploy

From your cloud provider folder e.g. cd aws/ deploy the integration

layer-integrations deploy

You will be prompted to login with your Layer Dashboard credentials, pick your organization, application and a webhook secret.

There is an additional prompt for fake service key service_key to demonstrate how to use configuration values as part of the deployment input.

Logs

Once the integration is successfully deployed you can access logs using Serverless CLI

serverless logs -f webhook -t

Send some messages from your Layer application and watch the logs roll in. You should be able to see sender identity object in the console.

Next steps

Once you understand the basics of how this integration works, you can take the contents of cloud provider folder aws or azure and start experimenting on your own.

For more information read Serverless docs and start building your own integration.