Serverless Add-ons

Serverless add-ons are implemented using AWS Lambda functions. These can be hosted by ServiceM8, or by you.

ServiceM8 Add-ons can be built without needing to manage any server resources, and can be either directly hosted on ServiceM8's infrastructure, or by using AWS Lambda. AWS Lambda is a serverless compute service that automatically manages the underlying compute resources for you, from a few requests per day to thousands per second.

Simple Function Add-on

Set up your add-on as a Simple Function Add-on and ServiceM8 will manage all infrastructure requirements. You supply the code; we run it. To edit your code, click the Edit Function button in your Add-on's settings page. Refer to Event Data for more information about the arguments provided to your function when it's invoked.

Your Simple Function must be written in NodeJS v12, if you would prefer to use Python, C# or Java you'll need to use a Web Service hosted add-on instead.

ServiceM8 Secure Token Service

The ServiceM8 Secure token service simplifies the process of add-ons being able to communicate with the ServiceM8 API via OAuth. Normally, API integrations are required to complete the OAuth authentication flow, and then manage their OAuth access token, refreshing the token periodically. However, to reduce the burden of managing access tokens within a serverless environment ServiceM8 can automatically issue your add-on with a short-lived access token (900 seconds) for each invocation of your Lambda function.

The access token is provided as part of the event data for each request , and can be used immediately to read and write data from ServiceM8 APIs. The access token is scoped to the OAuth scope you specify in your add-on manifest file.

What’s Next

See the event data that's supplied when your Lambda function is invoked.