Stedi Function Templates
This repository holds the source code for functions that can be deployed as templates using the Stedi CLI.
List of function templates
To see the list of the available function templates, take a look at the src/functions directory.
Deploying function templates
Prerequisites
-
Install Node.js (minimum version: 18)
-
Install the latest version of the Stedi CLI:
npm install --global @stedi/cli@latest
If you've installed the CLI previously, be sure to update it to the latest version. The easiest way to do this is by running the same installation command again.
Function template installation and deployment
-
Use the
stedi integrations init
CLI command to create and initialize a new Stedi Integrations SDK project (choose a path that does not exist yet -- it will be created):stedi integrations init --path=<PATH_TO_PROJECT_DIRECTORY>
-
Change directories to newly created SDK project directory:
cd <PATH_TO_PROJECT_DIRECTORY>
-
Install SDK project dependencies:
npm install
-
Use the
install-template
script to install each function template(s) that you would like to install:npm run install-template event-to-webhook
Note: the available function templates can be found in the src/functions directory.
-
Edit the
.env
file to add your Stedi API key:STEDI_API_KEY=<YOUR_STEDI_API_KEY>
-
For each function template that you installed, complete any post-install instructions as documented in the
README.md
in the function's source directory. For example, the post-install instructions for theevent-to-webhook
function template can be found here: src/functions/event-to-webhook/README.md#post-install-instructions -
After completing all necessary post-install instructions, deploy the function(s) to your Stedi account:
npm run deploy
-
For each function template that you installed, complete any post-deployment instructions as documented in the
README.md
in the function's source directory. For example, the post-deployment instructions for theevent-to-webhook
function template can be found here: src/functions/event-to-webhook/README.md#post-install-instructions