Templates

Appwrite provides a variety of Function Templates to help you jump start your function development. You can use Appwrite Function Templates as examples or boilerplates to add new functionality to your Appwrite project.

Find templates

You can find all available templates by navigating to the Appwrite Console, under your project > Functions > Templates.

Templates screen

Templates screen

You can filter functions by searching, filter by use case, or filter by runtime. Click Create function to create a function from a template.

Create with templates

The create function wizard has five steps.

Configuration

Pick a display name for your function and an ID. You will later use the ID to programmatically execute or configure the function. Pick the runtime language you wish the function to be created in, not all runtimes are available for all templates.

Variables

Appwrite Functions uses environment variables to pass constants and secrets to your Appwrite Functions. You'll provide information like API keys and other secrets to integrations in this step. If you need an Appwrite API key, you'll be propted to generate one.

Connect

You can choose to clone a new repository to your GitHub profile or organization, or to connect to an existing repository.

If you choose connect to an existing repository, the function's code will be cloned to the root folder you specify under the Branch step.

Repository

Configure the connected respository for your Appwrite Function. This will be the repository holding the source code for your function. When the code in this repository is updated, new deployments will be created.

Branch

Production branch specifies the branch connected to your Appwrite Function. When new commits are made to this branch, a new deployment is automatically created and deployed.

The root directory specifies the folder holding your function template's code.

When a PR is made to the branch, a new deployment is built, but not activated. A comment is made to your PR about the build, unless you enable Silent mode.

Available templates

TemplateDescriptionRuntimes
StarterA simple starter function that returns "Hello, world!"Node.js, Python, PHP, Dart, Node.js (TypeScript), Bun, Deno, Ruby, Kotlin, C++, .NET, Java, Swift
Sync with MeilisearchSyncs documents in an Appwrite database collection to a Meilisearch index to add search-as-you-type search boxes to your app.Node.js, Python, PHP, Node.js (TypeScript), Bun, Deno, Ruby, Kotlin
WhatsApp with VonageSimple bot to answer WhatsApp messages.Node.js, Python, PHP, Dart, Node.js (TypeScript), Bun, Deno, Ruby
Prompt ChatGPTAsk question, and let OpenAI GPT-3.5-turbo answer.Node.js, Python, PHP, Dart
Censor with RedactAutomatically remove sensitive data from messages.Node.js, Python, Dart
Email Contact FormSends an email with the contents of a HTML form.Node.js, Python, PHP
Sync with AlgoliaIntuitive search bar for any data in Appwrite Databases.Node.js, Python, PHP
Discord Command BotAdd Discord commands to your servers using Discord Interactions.Node.js, Python
Github Issue BotAutomate the process of responding to newly opened issues on a GitHub repository.Node.js, Node.js (TypeScript)
Analyze with PerspectiveAPIAutomate moderation by using AI to measure the toxicity of messages.Node.js
Generate PDFGenerate PDFs programmatically with Appwrite Functions.Node.js
Payments with StripeReceive card payments and store paid orders.Node.js
Push Notification with FCMSend push notifications to your users using Firebase Cloud Messaging (FCM).Node.js
Slack Command BotSimple command bot using Slack APINode.js
Storage CleanerStorage cleaner function to remove all files older than X number of days from the specified bucket.Node.js
Subscriptions with StripeReceive recurring card payments and grant subscribers extra permissions.Node.js
URL ShortenerGenerate URL with short ID and redirect to the original URL when visited.Node.js