Skip to content
masterclass Buddy

Cypress · Method

Cypress.env

cy.env() reads selected Cypress environment values for a test. It is intended for sensitive values such as API keys, passwords, and tokens, and returns only the keys requested.

Last updated

Since
15.10.0

Syntax

cy.env(keys)
cy.env(keys, options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Cypress.expose()
  • Cypress.env()
  • cy.origin()
  • cy.session()
  • cypress.env.json
  • allowCypressEnv

Source: cy.env() | Cypress API Documentation. Checked 2026-11-03.