(Updated: )

Changelog: Extended Handlebars template functions & Groups API

Share on social

Extended Handlebars Check & Groups API functions

Here is an overview of the features & fixes we released over the last month:

Extended template functions

We improved our Handlebars support by adding new helpers that will make creating checks and alerts easier and more powerful.

1. Random number and UUID generators

In some scenario's, using a setup script just to generate some data on each check run is a bit overkill. You can now use the tags {{$UUID}} and {{$RANDOM_NUMBER}} throughout your API checks and templates. You will see them pop up in the drop down when you add variables.

2. Handlebars conditional helpers

We added a bunch of extra Handlebars helpers. These are mostly handy when creating webhooks. Here is an example of how you could turn our own ALERT_TYPE variable into the strings "UP" and "DOWN".

  "message": "Check is {{#eq ALERT_TYPE 'ALERT_FAILURE'}}DOWN{{/eq}} {{#eq ALERT_TYPE 'ALERT_RECOVERY'}}UP{{/eq}}"

Based on the event this would trigger either "Check is UP" or "Check is DOWN"

Two clear benefits here:

  • You only need to create one webhook to inform a 3rd party system.
  • You can translate Checkly terms to your 3rd party tool's term for the same concept, i.e. the "up status" of a check.

Our simple Handlebars wrapper used in our codebase is now open-sourced at GitHub and also available as a package on NPM.

Check out the package README for how to utilize these new helpers.

Groups API

You can now create, update and delete check groups via our public API. This is useful if you want to create checks in bulk that share defaults and common settings like run locations and alerting channel.

With the API you can:
- List all check groups
- Create a check group
- Update a check group
- Delete a check group
- List all checks in a check group

Check out our API docs for more information

Share on social