{"id":21813264,"url":"https://github.com/morficus/cypress-dotenv","last_synced_at":"2025-04-10T01:12:48.926Z","repository":{"id":37884048,"uuid":"224530653","full_name":"morficus/cypress-dotenv","owner":"morficus","description":"Cypress plugin that enables compatability with dotenv","archived":false,"fork":false,"pushed_at":"2025-04-01T02:38:54.000Z","size":779,"stargazers_count":55,"open_issues_count":2,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T01:12:25.459Z","etag":null,"topics":["cypress","cypress-dotenv","cypress-plugin","cypressjs","dotenv","environment-variables","envvars"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morficus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-27T22:55:55.000Z","updated_at":"2025-02-17T11:03:35.000Z","dependencies_parsed_at":"2023-12-24T00:27:15.723Z","dependency_job_id":"23215a83-541a-4c5a-b6c6-670504ff7a00","html_url":"https://github.com/morficus/cypress-dotenv","commit_stats":{"total_commits":40,"total_committers":10,"mean_commits":4.0,"dds":0.375,"last_synced_commit":"dd64638780377da64e7889b4cd3935c46c1e55b5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morficus%2Fcypress-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morficus%2Fcypress-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morficus%2Fcypress-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morficus%2Fcypress-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morficus","download_url":"https://codeload.github.com/morficus/cypress-dotenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137890,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","cypress-dotenv","cypress-plugin","cypressjs","dotenv","environment-variables","envvars"],"created_at":"2024-11-27T14:28:16.218Z","updated_at":"2025-04-10T01:12:48.908Z","avatar_url":"https://github.com/morficus.png","language":"JavaScript","readme":"# Cypress dotenv\n\nCypress plugin that enables compatibility with [dotenv](https://www.npmjs.com/package/dotenv).  \n\n\u003e [!NOTE]\n\u003e If you need support for Cypress v9 or below, please use [v2.x of this plugin](https://github.com/morficus/cypress-dotenv/tree/v2.0.2)\n\n\n[![Build Status](https://travis-ci.org/morficus/cypress-dotenv.svg?branch=master)](https://travis-ci.org/morficus/cypress-dotenv)\n[![Maintainability](https://api.codeclimate.com/v1/badges/0d189dae8e924ada81ad/maintainability)](https://codeclimate.com/github/morficus/cypress-dotenv/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/0d189dae8e924ada81ad/test_coverage)](https://codeclimate.com/github/morficus/cypress-dotenv/test_coverage)\n\nPlease note that as of v2.0 this plugin only support Node v10+, Cypress 8+ and dotenv 10+  \nIf you are still using older versions, then please install v1.x instead \n\n## What does this thing do?\nIt will load any [`environment variables`](https://docs.cypress.io/guides/guides/environment-variables.html#Option-2-cypress-env-json) defined in your `.env` file so you can access them via `Cypress.env()` from within your tests as you would expect.\n\nAny [Cypress config options](https://docs.cypress.io/guides/references/configuration.html) defined in your `.env` will also be applied and take precedence over what is in your `cypress.json` file. See the [Cypress docs for details on this](https://docs.cypress.io/guides/references/configuration.html#Environment-Variables)\n\nFor example, if your `.env` file has something like this:\n\n```text\nCYPRESS_HELLO=hola\nGOODBYE=adios\n```\n\nYou can use `Cypress.env('HELLO')` to access its value.\n\n## Install\nYou will also need to install the original `dotenv` package along with `cypress-dotenv`\n```bash\nnpm install --save-dev dotenv cypress-dotenv \n```\nor\n```\nyarn add --dev dotenv cypress-dotenv\n```\n\n## Configure\n\nVersion 3.x of this plugin only supports Cypress v10+. For instructions on how to set up this plugin with older versions of Cypress, please refer to the [v2.x README](https://github.com/morficus/cypress-dotenv/tree/v2.0.2?tab=readme-ov-file#configure)\n\n\nSince this is a plugin, you will need to modify your `cypress.config.js` to look something like this\n\n```typescript\nimport { defineConfig } from 'cypress'\nimport dotenvPlugin from 'cypress-dotenv'\n\nexport default defineConfig({\n e2e: {\n\t...\n\tsetupNodeEvents(on, config) {\n\t\tconst updatedConfig = dotenvPlugin(config, null, true)\n\t\t// continue loading other plugins\n\t\treturn updatedConfig\n\t},\n\t},\n\t...\n})\n```\n\n\n\n## Options\nThis plugin takes three parameters:\n\n1. The first parameter (which is mandatory) is the Cypress config object. \n1. The second is an optional [dotenv](https://www.npmjs.com/package/dotenv#config) config object.\n1. The third (called `all`) is an optional boolean parameter, which is set to false by default. If set to true, it returns all available environmental variables, not limited to those prefixed with CYPRESS_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorficus%2Fcypress-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorficus%2Fcypress-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorficus%2Fcypress-dotenv/lists"}