PHPackages                             skauk/composer-auth-dotenv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. skauk/composer-auth-dotenv

ActiveComposer-plugin[Authentication &amp; Authorization](/categories/authentication)

skauk/composer-auth-dotenv
==========================

A composer install helper for private packages

1.0(10mo ago)32.1kMITPHPPHP ^8.0CI passing

Since Jul 16Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/skauk/composer-auth-dotenv)[ Packagist](https://packagist.org/packages/skauk/composer-auth-dotenv)[ GitHub Sponsors](https://github.com/rcknr)[ RSS](/packages/skauk-composer-auth-dotenv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

composer-auth-dotenv
====================

[](#composer-auth-dotenv)

[![Packagist version](https://camo.githubusercontent.com/e2fd91fbc5f1b7f7486d66c2bc219e8ac1c0277d83ebd1ef5b90faa74dc8ff06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736b61756b2f636f6d706f7365722d617574682d646f74656e762e7376673f6d61784167653d33363030)](https://packagist.org/packages/skauk/composer-auth-dotenv)[![MIT license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d7cbd41c2e57da5494ee95167db8c6783d237973c02fce9a29c4e587d723da89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736b61756b2f636f6d706f7365722d617574682d646f74656e762f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d6d61696e)](https://github.com/skauk/composer-auth-dotenv/actions)[![Coverage Status](https://camo.githubusercontent.com/efdb27f9c3092caa55cd64265da48a9eafcd2924e8abcc16fc9ed2932ec02e82/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736b61756b2f636f6d706f7365722d617574682d646f74656e762f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/repos/github/skauk/composer-auth-dotenv/badge.svg?branch=main)[![Packagist downloads](https://camo.githubusercontent.com/ad7fc3853d683c51fc453eb69785cef6b4494c5d6d0dee96a055995d6d357ed1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736b61756b2f636f6d706f7365722d617574682d646f74656e762e7376673f6d61784167653d33363030)](https://packagist.org/packages/skauk/composer-auth-dotenv)

This [Composer](https://getcomposer.org/) plugin lets you store credentials for private packages in a `.env` file, using the same format as the `COMPOSER_AUTH` environment variable. This approach avoids using `auth.json`, keeps credentials out of version control, and makes them easier to manage and encrypt alongside other environment-specific configuration. This repository is inspired by [private-composer-installer](https://github.com/ffraenz/private-composer-installer).

Motivation
----------

[](#motivation)

In Laravel ecosystem there are many commercially distributed packages that require authentication to be installed. The usual way to authenticate is to use the `auth.json` file, which is then ignored (or not) by version control. It is more practical, however, to be able to store credentials in a `.env` file, which is already used for other environment-specific configuration. The `.env` file can be encrypted and decrypted using the `php artisan env:encrypt` and `php artisan env:decrypt` commands. The encryption key can be shared with team members to securely grant access to all necessary project secrets. This *might* make it easier and safer to manage composer credentials in your development team.

Setup
-----

[](#setup)

- Add the desired private package to the `repositories` section inside `composer.json`. Find more about Composer repositories in the [Composer documentation](https://getcomposer.org/doc/05-repositories.md#repositories).
- Configure authentication using `composer config`. This will create an `auth.json` file. Different supported options are described in the [Composer documentation](https://getcomposer.org/doc/articles/authentication-for-private-packages.md)
- Convert `auth.json` content to COMPOSER\_AUTH environment variable format and append it to your `.env` file:

```
echo -n "COMPOSER_AUTH=" >> .env && cat auth.json | tr -d '\n[:space:]' >> .env

```

Configuration
-------------

[](#configuration)

The configuration options listed below may be added to the `extra` section of `composer.json` like so:

```
{
  "name": "...",
  "description": "...",
  "require": {
  },
  "extra": {
    "composer-auth-dotenv": {
      "dotenv-path": ".",
      "dotenv-name": ".env"
    }
  }
}
```

### dotenv-path

[](#dotenv-path)

Dotenv file directory relative to the root path (where `composer.json` is located). By default, dotenv files are expected to be in the root folder.

### dotenv-name

[](#dotenv-name)

Dotenv file name. Defaults to `.env`.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bd38700e61a599068017cad8e474d83ecbf30153e6ed3c736a9280d24f546ff?d=identicon)[skauk](/maintainers/skauk)

---

Top Contributors

[![ffraenz](https://avatars.githubusercontent.com/u/1041468?v=4)](https://github.com/ffraenz "ffraenz (82 commits)")[![skauk](https://avatars.githubusercontent.com/u/471067?v=4)](https://github.com/skauk "skauk (20 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")[![ihorvorotnov](https://avatars.githubusercontent.com/u/1066083?v=4)](https://github.com/ihorvorotnov "ihorvorotnov (2 commits)")[![pierrotevrard-idp](https://avatars.githubusercontent.com/u/57230131?v=4)](https://github.com/pierrotevrard-idp "pierrotevrard-idp (2 commits)")[![macbookandrew](https://avatars.githubusercontent.com/u/784333?v=4)](https://github.com/macbookandrew "macbookandrew (1 commits)")

---

Tags

plugincomposerauthenvdotenv

### Embed Badge

![Health badge](/badges/skauk-composer-auth-dotenv/health.svg)

```
[![Health](https://phpackages.com/badges/skauk-composer-auth-dotenv/health.svg)](https://phpackages.com/packages/skauk-composer-auth-dotenv)
```

###  Alternatives

[ffraenz/private-composer-installer

A composer install helper for private packages

2331.7M5](/packages/ffraenz-private-composer-installer)[philippbaschke/acf-pro-installer

An install helper for Advanced Custom Fields PRO

283724.6k](/packages/philippbaschke-acf-pro-installer)[hapidjus/laravel-impersonate-ui

UI for 404labfr/laravel-impersonate

371.5k](/packages/hapidjus-laravel-impersonate-ui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
