Function Templates
Function templates are pre-configured functions that you can use as a starting point for common integration tasks, such as routing errors to an internal alerting system. Templates contain all of the event bindings and environment variables to accomplish each task.
After you create a function from a template, you can customize it to add error handling and other behavior for your use case.
We continually maintain our function template library to ensure each function is up-to-date with new Stedi features and programming best practices.
Create functions from templates
To create functions from a template:
- Go to the Functions UI and click the Templates tab to review available function templates.
- Click Select for the template you want to use to open its configuration modal.
- Click Deploy.
- Choose a Name for the function and set existing environment variables (if available).
- Click Create function. Stedi deploys the function in your account and configures event bindings if necessary.
Environment variables
Templates come with pre-configured environment variables relevant to the function's purpose. For example, environment variables may define parameters such as as API keys, authentication tokens, and webhook URLs.
After you create a function from the template, you can edit the function to change these pre-configured environment variables according to your needs.
Event bindings
After you create a function from the template, you can edit the function to change these pre-configured event bindings according to your needs.
Template Code
After you create a function from a template, you can edit the function's template code according to your needs. We recommend adding error handling before you use the function in production.
We regularly push updates to function templates. However, Stedi does not automatically update functions created from a template when we publish a new version of that template.
Feedback
Have an idea for something we could improve? Page not clear? We love feedback - send us a message.