> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage FastEdge apps

export const MethodSection = ({children}) => children ?? null;

export const MethodSwitch = ({children}) => {
  const tabs = React.Children.toArray(children).map(c => {
    if (!c || !c.props) return null;
    if (c.props.id) return c;
    const inner = c.props.children;
    if (inner && inner.props && inner.props.id) return inner;
    return null;
  }).filter(Boolean);
  const firstId = tabs.length > 0 ? tabs[0].props.id : "";
  const [active, setActive] = React.useState(firstId);
  React.useEffect(() => {
    try {
      const saved = localStorage.getItem("gcore_docs_method");
      if (saved && tabs.find(t => t.props.id === saved)) {
        setActive(saved);
      }
    } catch (_) {}
  }, []);
  React.useEffect(() => {
    try {
      document.querySelectorAll("h2[id], h3[id]").forEach(heading => {
        const visible = heading.offsetParent !== null;
        document.querySelectorAll(`a[href="#${heading.id}"]`).forEach(link => {
          if (link.closest("h1,h2,h3,h4,h5,h6")) return;
          const li = link.closest("li");
          if (li) li.style.display = visible ? "" : "none";
        });
      });
    } catch (_) {}
    window.dispatchEvent(new Event("scroll"));
  }, [active]);
  const handleClick = id => {
    setActive(id);
    try {
      localStorage.setItem("gcore_docs_method", id);
    } catch (_) {}
  };
  return <div>
      <div className="not-prose flex gap-0 border-b border-zinc-200 dark:border-zinc-800 mb-8 mt-2" role="tablist">
        {tabs.map(tab => {
    const isActive = active === tab.props.id;
    return <button key={tab.props.id} role="tab" aria-selected={isActive} onClick={() => handleClick(tab.props.id)} className={["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer", isActive ? "border-primary text-primary" : "border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" ")}>
              {tab.props.label}
            </button>;
  })}
      </div>

      {tabs.map(tab => <div key={tab.props.id} style={{
    display: active === tab.props.id ? "" : "none"
  }}>
          {tab.props.children}
        </div>)}
    </div>;
};

<MethodSwitch>
  <MethodSection id="portal" label="Customer Portal">
    <p>The application management page provides access to all settings and runtime data for a deployed FastEdge application in one place.</p>

    <p>To open the management page:</p>

    1. In the [Gcore Customer Portal](https://portal.gcore.com/accounts/reports/dashboard), navigate to **FastEdge** and select either **HTTP Applications** or **CDN Applications**.

    2. On the **Applications** page, click the three-dot icon next to the application and select **Manage**.

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/manage-apps-menu.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=dd8cf52ea34028fd5c4c981f036fe303" alt="HTTP Applications list with the three-dot menu open showing Stop, Manage, and Delete options" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/manage-apps-menu.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/app-management-page-annotated.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=ed3392f0b9cb813c395d85d41c407db4" alt="FastEdge application management page showing the Save changes and Actions buttons and the Metrics, Logs, Response headers, Environment variables, Secrets, and Edge Storage tabs" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/app-management-page-annotated.png" />
    </Frame>

    <p>The following tabs are available on the management page:</p>

    * **Metrics**: response status counts and runtime duration charts.
    * **Logs**: enable log collection and filter log entries.
    * **Response headers**: add HTTP headers to every application response.
    * **Environment variables**: define configuration values the application reads at runtime.
    * **Secrets**: link encrypted secrets from Secrets Manager to the application.
    * **Edge Storage**: link key-value stores to the application.

    <p>The table below describes when to use each configuration option:</p>

    | Feature               | Use for                                                                                 |
    | --------------------- | --------------------------------------------------------------------------------------- |
    | Response headers      | HTTP headers added to every response — CORS, cache control, security headers            |
    | Environment variables | Configuration values available to the application at runtime, up to 64 KB each          |
    | Secrets               | API keys, credentials, and other sensitive values encrypted at rest                     |
    | Edge Storage          | Shared mutable key-value data the application reads at runtime                          |
    | Dictionary            | Parameters over 64 KB and read-only edge node metadata — accessed from application code |

    ## Application lifecycle

    <p>Use the **Actions** button in the page header to control the application lifecycle — stop or restart it, deploy a new binary, save its configuration as a reusable template, or delete it entirely.</p>

    * **Stop** — pause the application. Stopped applications don't process requests.
    * **Start** — resume a stopped application.
    * **Edit application** — update the application name or description.
    * **Update binary** — upload a new compiled Wasm binary.
    * **Create template** — save the current configuration as a reusable template.
    * **Delete** — permanently remove the application.

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/stop-app.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=e470cfaa0a1201dacc80ddc02f2a410a" alt="Application management page with the Actions menu open showing Stop, Edit application, Update binary, Create template, and Delete" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/stop-app.png" />
    </Frame>

    <p>An application may also stop automatically if payment for the product fails. In that case, it can't be restarted until payment is completed.</p>

    ## Metrics

    <p>The **Metrics** tab shows two charts: **Response Status** groups completed requests by HTTP status code, and **Runtime Duration (ms)** shows execution time per request in milliseconds. Use the time-range dropdown and the interval control in the chart header to adjust the view.</p>

    ## Logs

    <p>Logging is disabled by default. After enabling, the application records logs for 30 minutes, then stops automatically.</p>

    <p>To enable logging:</p>

    1. Select the **Logs** tab.

    2. Turn on the **Enable logging** toggle.

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/view-logging.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=cd10d1f8b4dddd46b6d6ee20853d2bc6" alt="Logs tab with the Enable logging toggle turned on and Minutes remaining showing 30" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/view-logging.png" />
    </Frame>

    <p>The remaining logging time appears next to the toggle as **Minutes remaining: N**. To extend logging, turn the toggle off and on again.</p>

    <p>Log entries appear in the table with the following columns:</p>

    * **Client IP address** — IP of the client that sent the request.
    * **Timestamp (UTC)** — time the request was received.
    * **Edge name** — identifier of the edge node that handled the request.
    * **Request ID** — unique identifier assigned to the request.
    * **Logs** — application log output for that request.

    <p>Use the text search field above the table to filter by log content, or select a date range. The **Refresh rate** dropdown controls how often the table updates — it defaults to 10 seconds when logging is active.</p>

    ## Application configuration

    <p>The **Response headers**, **Environment variables**, **Secrets**, and **Edge Storage** tabs each control a different aspect of how the application receives configuration and accesses external data at runtime. Click **Save changes** to apply any edits. The dictionary is a separate read-only data source that the application accesses directly from code.</p>

    ### Response headers

    <p>Use response headers to add CORS, cache-control, security, or custom headers to every application response.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/response-headers.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=6997a7900126a99462eca25ccd9d4e21" alt="Response headers tab with an Access-Control-Allow-Origin header set to https://example.com" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/response-headers.png" />
    </Frame>

    <p>To add a header, click **Add response header**, enter the header name in the **Key** field and the value in the **Value** field, then click **Save changes**.</p>

    ### Environment variables

    <p>Environment variables pass configuration values to the application at runtime. Each variable can store up to 64 KB of data; for larger values, define the parameter here and read it from code through the [dictionary](#dictionary) using the same key name.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/env-vars.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=6428ea0b060cfce6198cff2f0cd2994d" alt="Environment variables tab with three variables configured showing key-value pairs" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/env-vars.png" />
    </Frame>

    <p>To add a variable, click **Add environment variable**, enter the variable name in the **Key** field and its value in the **Value** field, then click **Save changes**.</p>

    <p>Access environment variables in code using the [JavaScript SDK](https://g-core.github.io/FastEdge-sdk-js/reference/fastedge/env/) or standard Rust `std::env::var("KEY_NAME")`.</p>

    ### Secrets

    <p>Use environment variables for ordinary configuration values. When a value is sensitive — an API key, access token, or password — store it as a secret instead.</p>

    <p>Secrets let an application access sensitive values without storing them directly in its configuration. Each secret is stored in [Secrets Manager](/fastedge/secrets-manager/manage-secrets) and linked to the application under a local key name that the code uses to retrieve the value at runtime.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/secrets.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=867d18b92bc7dabe7bd2ed5ac23feb0a" alt="Secrets tab with ACCESS_KEY linked to the S3_ACCESS_TOKEN_BINARY_DUMP secret from Secrets Manager" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/secrets.png" />
    </Frame>

    <p>To link a secret:</p>

    1. Click **Add secret**.

    2. In the **Key** field, enter the name the application will use to reference the secret.

    3. In the second field, select a secret from Secrets Manager. To create a new secret first, select **Add secret** in the dropdown.

    4. Click **Save changes**.

    <p>Access the secret in code using `secret::get("KEY_NAME")` in the [Rust SDK](https://docs.rs/fastedge/latest/fastedge/secret/index.html), or [`getSecret`](https://g-core.github.io/FastEdge-sdk-js/reference/fastedge/secret/get-secret/) in the JavaScript SDK.</p>

    ### Edge Storage

    <p>Edge Storage provides a shared key-value store that applications can read and update at runtime. Link a store under a local key name, and the code uses that name to open and query it.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/MFAXqa6tFHU8UZIW/images/docs/fastedge/manage-apps/storage.png?fit=max&auto=format&n=MFAXqa6tFHU8UZIW&q=85&s=c3b865e7abb9e9398e86212f9a406cda" alt="Edge Storage tab with BLACKLIST linked to the KNOWN_BAD_IP_ADDRESSES store" width="1536" height="730" data-path="images/docs/fastedge/manage-apps/storage.png" />
    </Frame>

    <p>To link a store:</p>

    1. Click **Add Edge Storage**.

    2. In the **Key** field, enter the name the application will use to open the store.

    3. In the second field, select a store from [Edge Storage](/fastedge/kv-stores/manage-kv-store). To create a new store first, select **Add Edge Storage** in the dropdown.

    4. Click **Save changes**.

    <p>Access the store in code using `Store::open("KEY_NAME")` in the [Rust SDK](https://docs.rs/fastedge/latest/fastedge/key_value/struct.Store.html), or [`open`](https://g-core.github.io/FastEdge-sdk-js/reference/fastedge/kv/open/) in the JavaScript SDK.</p>

    ### Dictionary

    <p>The dictionary gives application code read-only access to edge node metadata that FastEdge populates automatically on every node, and to application parameters that exceed the 64 KB environment variable limit.</p>

    **Edge node metadata**

    <p>FastEdge automatically populates the following keys on every edge node. These values reflect the physical node handling each request:</p>

    | Key            | Description                                                                                                                                            |
    | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `hostname`     | Hostname of the edge node                                                                                                                              |
    | `env`          | Deployment environment: `prod` or `preprod`                                                                                                            |
    | `role`         | Node role: `edge` or `shield`                                                                                                                          |
    | `region`       | Geographic region of the edge node: `africa`, `asia`, `au`, `cis`, `eu`, `latam`, `me`, `na`. Additional values may be returned for reseller networks. |
    | `country`      | Full name of the country where the node is located                                                                                                     |
    | `country2char` | ISO 3166-1 alpha-2 country code                                                                                                                        |
    | `city`         | City where the node is located                                                                                                                         |
    | `dc`           | Point of Presence (PoP) identifier                                                                                                                     |
    | `ipv4_addr_ip` | IPv4 address of the edge node                                                                                                                          |
    | `ipv6_addr_ip` | IPv6 address of the edge node                                                                                                                          |
    | `ipv6_enabled` | Whether IPv6 is enabled on the node: `true` or `false`                                                                                                 |

    <p>Built-in keys take priority over application parameters with the same name. To avoid unexpected behavior, don't use built-in key names as environment variable names.</p>

    **Large application parameters**

    <p>Standard environment variable access is limited to 64 KB per value. For parameters that exceed this limit, define them on the **Environment variables** tab and read them through the dictionary using the same key name.</p>

    **Read dictionary values in code**

    <p>In Rust, use the [`dictionary` module](https://docs.rs/fastedge/latest/fastedge/dictionary/index.html):</p>

    ```rust theme={null}
    use fastedge::dictionary;

    if let Some(value) = dictionary::get("country") {
        // use value
    }
    ```

    <p>In JavaScript, dictionary values are exposed through `getEnv()` from the [`fastedge::env`](https://g-core.github.io/FastEdge-sdk-js/reference/fastedge/env/) module:</p>

    ```js theme={null}
    import { getEnv } from 'fastedge::env';

    const country = getEnv('country');
    ```
  </MethodSection>

  <MethodSection id="api" label="REST API">
    <p>All management operations use the <code>[https://api.gcore.com/fastedge/v1/apps/\{id}](https://api.gcore.com/fastedge/v1/apps/\{id})</code> endpoint, where `id` is the numeric application identifier returned by <code>GET /fastedge/v1/apps</code>.</p>

    <p>All requests authenticate with an [API token](/account-settings/api-tokens). Set it as an environment variable before running the examples:</p>

    ```bash theme={null}
    export GCORE_API_KEY="{YOUR_API_KEY}"
    ```

    ## Application lifecycle

    <p>To retrieve the current application state, including its configuration fields and binary ID:</p>

    ```bash theme={null}
    curl -X GET "https://api.gcore.com/fastedge/v1/apps/APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY"
    ```

    <p>The response includes all fields needed for subsequent PUT requests: `id`, `binary`, `name`, `status`, `rsp_headers`, `env`, `secrets`, and `stores`.</p>

    <p>To stop the application, send a PUT request with `"status": 0`. To start it again, use `"status": 1`. The PUT body must include all current field values — use the GET response as the base and update only the fields that change.</p>

    ```bash theme={null}
    curl -X PUT "https://api.gcore.com/fastedge/v1/apps/APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "id": APP_ID,
        "binary": BINARY_ID,
        "name": "app-name",
        "status": 0
      }'
    ```

    <p>To delete the application permanently:</p>

    ```bash theme={null}
    curl -X DELETE "https://api.gcore.com/fastedge/v1/apps/APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY"
    ```

    ## Metrics

    <p>Response Status and Runtime Duration are exposed through separate endpoints. **Response Status** groups completed requests by HTTP status code; **Runtime Duration** shows execution time per request in milliseconds. Both accept the same time-range parameters.</p>

    ```bash theme={null}
    # Response status counts
    curl "https://api.gcore.com/fastedge/v1/stats/calls?from=2026-06-17T00:00:00Z&to=2026-06-17T23:59:59Z&step=3600&id=APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY"

    # Runtime duration
    curl "https://api.gcore.com/fastedge/v1/stats/app_duration?from=2026-06-17T00:00:00Z&to=2026-06-17T23:59:59Z&step=3600&id=APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY"
    ```

    <p>The `step` parameter specifies the aggregation interval in seconds. The `from` and `to` parameters use ISO 8601 UTC format.</p>

    ## Logs

    <p>Logging is disabled by default and runs for 30 minutes after being enabled, then turns off automatically. Enable it by setting `"debug": true` in a PUT request.</p>

    ```bash theme={null}
    curl -X PUT "https://api.gcore.com/fastedge/v1/apps/APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "id": APP_ID,
        "binary": BINARY_ID,
        "name": "app-name",
        "status": 1,
        "debug": true
      }'
    ```

    <p>The response includes a `debug_until` field with the UTC timestamp when logging will stop. To read log entries:</p>

    ```bash theme={null}
    curl "https://api.gcore.com/fastedge/v1/apps/APP_ID/logs?from=2026-06-17T00:00:00Z&to=2026-06-17T23:59:59Z&offset=0&limit=50" \
      -H "Authorization: APIKey $GCORE_API_KEY"
    ```

    ## Application configuration

    <p>Response headers, environment variables, secrets, and Edge Storage are all updated with a single <code>PUT /fastedge/v1/apps/{id}</code> request. The body replaces the entire configuration — fields omitted from the request are cleared. Read the current state with GET first and use it as the base.</p>

    **Response headers**

    <p>Set headers in the `rsp_headers` object:</p>

    ```json theme={null}
    "rsp_headers": {
      "Access-Control-Allow-Origin": "*",
      "Cache-Control": "public, max-age=3600"
    }
    ```

    **Environment variables**

    <p>Set variables in the `env` object:</p>

    ```json theme={null}
    "env": {
      "API_BASE_URL": "https://api.example.com",
      "MAX_RETRIES": "3"
    }
    ```

    **Secrets**

    <p>To link a secret, get its numeric ID from <code>GET /fastedge/v1/secrets</code>, then reference it in the `secrets` object:</p>

    ```json theme={null}
    "secrets": {
      "MY_API_KEY": {"id": 636}
    }
    ```

    **Edge Storage**

    <p>To link a key-value store, get its numeric ID from <code>GET /fastedge/v1/kv</code>, then reference it in the `stores` object:</p>

    ```json theme={null}
    "stores": {
      "MY_STORE": {"id": 126}
    }
    ```

    <p>The following example updates all four configuration areas in one request:</p>

    ```bash theme={null}
    curl -X PUT "https://api.gcore.com/fastedge/v1/apps/APP_ID" \
      -H "Authorization: APIKey $GCORE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "id": APP_ID,
        "binary": BINARY_ID,
        "name": "app-name",
        "status": 1,
        "rsp_headers": {
          "Access-Control-Allow-Origin": "*"
        },
        "env": {
          "API_BASE_URL": "https://api.example.com"
        },
        "secrets": {
          "MY_API_KEY": {"id": 636}
        },
        "stores": {
          "MY_STORE": {"id": 126}
        }
      }'
    ```

    ## Runtime data

    ### Dictionary

    <p>The dictionary is populated automatically by FastEdge on every edge node and is not configurable through the API. Access it from application code using the SDK — see the Customer Portal tab for the full key reference and code examples.</p>
  </MethodSection>
</MethodSwitch>
