From 88a75264e70effbe0773f3b393266965ec41ab53 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 9 Dec 2022 12:08:37 +0000 Subject: [PATCH] docs: improve documentation for fastly:env and add full c@e example including fiddle --- types/fastly:env.d.ts | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/types/fastly:env.d.ts b/types/fastly:env.d.ts index 06509d8465..5834cee62a 100644 --- a/types/fastly:env.d.ts +++ b/types/fastly:env.d.ts @@ -3,9 +3,33 @@ declare module "fastly:env" { * Function to get the value for the provided environment variable name. * * For a list of available environment variables, see the [Fastly Developer Hub for C@E Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) + * + * **Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. * * @param name The name of the environment variable - * @returns The value of the environment variable + * + * @example + * + * In this example we log to stdout the environment variables `FASTLY_HOSTNAME` and `FASTLY_TRACE_ID`. + * + * View this example on Fastly Fiddle + * */ - export function env(name: string): string; + function env(name: string): string; }