---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [config](../index.md) / applyEnvFile

# Function: applyEnvFile()

> **applyEnvFile**(`filePath`, `env`): `string`[]

Defined in: [packages/b2c-tooling-sdk/src/config/project-environment.ts:80](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/36eea0d308f1312d1a446ec8813ed30b0bdba62c/packages/b2c-tooling-sdk/src/config/project-environment.ts#L80)

Loads env file variables into an environment object without overriding
values that are already set (shell variables win).

`SFCC_DOTENV_FILE` is ignored inside env files (no chaining). A relative
`SFCC_CONFIG` resolves from the env file's directory.

## Parameters

### filePath

`string`

### env

`Record`\<`string`, `string` \| `undefined`\> = `process.env`

## Returns

`string`[]

Names of the variables that were applied
