---
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/bceb8da43dd8bc63d57932bbd905d36a1b40c949/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
