Skip to main content
Manage environment variables in HopX sandboxes to configure execution environments. This hub covers all environment variable operations, from basic get/set to advanced bulk updates.

What You’ll Learn

  • How to get and set environment variables
  • How to update existing variables
  • How to clear all environment variables
  • How to use environment variables in code execution
  • How to manage variables across sandbox sessions

Environment Variables Overview

OperationSDK MethodAPI Endpoint
Gettingsandbox.env.get() / env.get_all()GET /env
Settingsandbox.env.set() / env.set_all()PUT /env
Updatingsandbox.env.update()PATCH /env
Clearingsandbox.env.clear()DELETE /env

Core Concepts

Getting Environment Variables

Retrieve environment variables from sandboxes.

Setting Environment Variables

Set environment variables in sandboxes.

Updating Environment Variables

Update existing environment variables without clearing others.

Clearing Environment Variables

Remove all environment variables from sandboxes.

SDK Reference

Python SDK

Complete reference for Python environment variable operations.
  • Environment Variables Module - Complete environment API
    • env.get() - Get single variable
    • env.get_all() - Get all variables
    • env.set() - Set single variable
    • env.set_all() - Set all variables
    • env.update() - Update variables
    • env.clear() - Clear all variables

JavaScript SDK

Complete reference for JavaScript/TypeScript environment variable operations.
  • Environment Variables Module - Complete environment API
    • env.get() - Get single variable
    • env.getAll() - Get all variables
    • env.set() - Set single variable
    • env.setAll() - Set all variables
    • env.update() - Update variables
    • env.clear() - Clear all variables

API Reference

VM Agent API

REST API endpoints for environment variable operations.

Quick Start

If you’re new to environment variables, start here:
  1. Getting Environment Variables - Read environment variables
  2. Setting Environment Variables - Set your first variable
  3. Updating Environment Variables - Update existing variables

Next Steps