# setEnvironment

> **setEnvironment**(`env?`): [`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/)

Defined in: config/environment.ts:116

Publish the environment for every later reader. Called by the client
entrypoints (`createIframe` / `createIFrameFrakClient` / the React
provider), so it runs more than once per page in normal use.

An omitted `env` is a no-op rather than "reset to production": a second
client built from a bare config would otherwise silently repoint the
first one's in-flight calls. The production default lives in
[getEnvironment](/developers/references/core-sdk/index/functions/getenvironment/) instead.

## Parameters

### env?

[`FrakEnvironment`](/developers/references/core-sdk/index/type-aliases/frakenvironment/)

## Returns

[`ResolvedEnvironment`](/developers/references/core-sdk/index/type-aliases/resolvedenvironment/)