Projects

Variables

Variables in Gigantics allow you to store and manage configuration values and sensitive information (like passwords or API keys) that can be used in your custom functions. This feature helps you avoid hardcoding values directly in your function code and provides a secure way to manage sensitive data.

Variable Types

There are two types of variables you can create:

  • Plain: Regular text variables that are stored as-is
  • Secret: Encrypted variables for sensitive data like passwords or API keys

Secret variables are encrypted before being stored in the database and are masked in the UI to prevent casual viewing.

Creating and Managing Variables

UI Overview

The Variables page presents a table view with the following columns:

ColumnDescription
NameThe identifier for your variable
TypeEither "Plain" or "Secret"
ValueThe actual value (masked for Secret variables)
Created ByThe user who created the variable
Created OnWhen the variable was created
ActionsEdit/Delete options (requires appropriate permissions)

Adding a New Variable

  1. Click the "Create" button in the top right corner
  2. A right panel will open with a form containing:
    • Name: Text input for the variable identifier
    • Type: Dropdown selector for "Plain" or "Secret"
    • Value: Text area for Plain variables or password input for Secret variables
  3. Fill in the required fields
  4. Click "Save" to create the variable

Editing a Variable

  1. Click the action menu (three dots) next to any variable
  2. Select "Edit" from the dropdown
  3. Modify the variable name, type, or value as needed
  4. Click "Save" to update the variable

Note: For Secret variables, if you don't change the value, the masked display (•••••••) will be preserved.

Deleting a Variable

  1. Click the action menu (three dots) next to any variable
  2. Select "Delete" from the dropdown
  3. Confirm the deletion in the modal dialog

Using Variables in Functions

Variables are designed to be used within custom functions. When you create a function that needs external configuration values or sensitive data, you can reference variables instead of hardcoding them.

How to Reference Variables

In your custom function code, you can use variables with the following syntax:

$(variable_name)

For example, if you have a variable named "api_key", you would reference it as:

$(api_key)

Benefits of Using Variables

  • Security: Sensitive information like passwords and API keys are encrypted and masked
  • Flexibility: Easily change configuration values without modifying function code
  • Reusability: Use the same variable across multiple functions
  • Collaboration: Team members can use variables without seeing their actual values

Best Practices

  1. Use Secret variables for sensitive data: Always use the "Secret" type for passwords, API keys, and other sensitive information
  2. Descriptive names: Use clear, descriptive names for your variables to make their purpose evident
  3. Environment-specific variables: Create different variables for different environments (development, staging, production) rather than changing values
  4. Regular cleanup: Remove unused variables to keep your project organized
  5. Access control: Only grant "ManageVariables" permissions to users who need to create or modify variables

Example Use Cases

  • Storing database connection strings for use in custom functions
  • Managing API keys for external services
  • Keeping configuration values like thresholds or limits
  • Storing email server credentials for notification functions

On this page