Actions181
- Account Actions
- Get Account
- Create Account
- Update Email
- Update Name
- Update Password
- Update Phone
- Update Status
- Get Preferences
- Update Preferences
- List Sessions
- Delete Sessions
- Get Session
- Update Session
- Delete Session
- Create Anonymous Session
- Create Email/Password Session
- Create Magic URL Session
- Create OAuth2 Session
- Create Phone Session
- Create Session from Token
- Create JWT
- Create Magic URL
- Create Phone Token
- Create Email Verification
- Update Email Verification
- Create Phone Verification
- Update Phone Verification
- Create Password Recovery
- Update Password Recovery
- Create Recovery
- Update Recovery
- Update MFA
- Create MFA Authenticator
- Update MFA Authenticator
- Delete MFA Authenticator
- Create MFA Challenge
- Update MFA Challenge
- Attribute Actions
- Avatars Actions
- Collection Actions
- Database Actions
- Document Actions
- Functions Actions
- Index Actions
- Locale Actions
- Messaging Actions
- Sites Actions
- Storage Actions
- Teams Actions
- Users Actions
Functions → Create Variable
AI-generatedOverview
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
- Creating an environment variable named 'API_KEY' with a secret value for a specific function to enable secure API access.
- 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
- Appwrite Functions Environment Variables - Official documentation on managing environment variables for Appwrite functions.