Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Functions → Create Variable

AI-generated

Overview

This node interacts with the Appwrite API to manage functions and their environment variables. Specifically, the 'Create Variable' operation allows users to create a new environment variable for a specified function by providing the function ID, the variable key, and its value. This is useful for dynamically configuring function behavior without modifying the function code directly, such as setting API keys or configuration flags.

Use Case Examples

  1. Creating an environment variable named 'API_KEY' with a secret value for a specific function to enable secure API access.
  2. Adding a configuration variable to toggle debug mode in a function without redeploying it.

Properties

Name Meaning
Function ID The unique identifier of the function to which the environment variable will be added.
Key The name of the environment variable key to create.
Value The value assigned to the environment variable key.

Output

JSON

  • json - The response from the Appwrite API after creating the environment variable, typically including details of the created variable.

Dependencies

  • Appwrite API
  • API key credential for authentication

Troubleshooting

  • Ensure the provided Function ID is correct and exists in the Appwrite project; otherwise, the API call will fail.
  • Verify that the API key credential has sufficient permissions to create environment variables for functions.
  • Check that the 'Key' and 'Value' fields are not empty, as they are required for creating a variable.
  • Common error messages may include authentication errors if the API key is invalid or permission errors if the user lacks rights to modify the function.

Links

Discussion