Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Sites → Create Variable

AI-generated

Overview

This node interacts with the Appwrite API to manage site variables. Specifically, the 'Create Variable' operation under the 'Sites' resource allows users to create a new variable for a specified site. This is useful for managing configuration or environment variables within a site hosted on Appwrite. For example, users can create variables to store API keys, feature flags, or other settings that the site can reference dynamically.

Use Case Examples

  1. Creating a new environment variable for a site to store an API key securely.
  2. Adding a feature flag variable to enable or disable features on a site without redeploying.

Properties

Name Meaning
Site ID The ID of the site where the variable will be created.
Variable ID The unique identifier for the variable. Can be auto-generated using unique().
Key The key name of the variable, used to reference it within the site.
Value The value assigned to the variable.
Is Secret Indicates whether the variable is a secret and should be encrypted.

Output

JSON

  • variableId - The unique ID of the created variable.
  • key - The key name of the created variable.
  • value - The value assigned to the created variable.
  • isSecret - Boolean indicating if the variable is secret (encrypted).

Dependencies

  • Appwrite API key credential with endpoint, project ID, and API key

Troubleshooting

  • Ensure the Site ID is correct and the site exists in Appwrite to avoid 'Unknown resource' errors.
  • If the variable ID is not unique, the API may reject the creation request; use unique() to generate a unique ID.
  • Check API key permissions to ensure the node has rights to create variables on the specified site.

Links

Discussion