***

title: setAllowedEnvPrefixes
slug: /reference/typescript/agents/data-map/set-allowed-env-prefixes
description: Set the allowed environment variable prefixes for this DataMap instance.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map

Set the allowed environment variable prefixes for this DataMap instance.
Overrides the global defaults. Only env vars whose names start with one of
these prefixes will be expanded. An empty array allows all variables.

## **Parameters**

<ParamField path="prefixes" type="string[]" required={true} toc={true}>
  Array of prefix strings to allow.
</ParamField>

## **Returns**

[`DataMap`][ref-datamap] -- Self for method chaining.

## **Example**

```typescript {5}
import { DataMap } from '@signalwire/sdk';

const dm = new DataMap('get_weather');
dm.enableEnvExpansion();
dm.setAllowedEnvPrefixes(['WEATHER_', 'APP_']);
dm.webhook('GET', 'https://api.weather.com/v1/current?key=${ENV.WEATHER_API_KEY}');
```