npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@evgen002/auth-dev

v1.3.1

Published

Dev-авторизация: получает токен и записывает его в .env как VITE_API_KEY

Readme

@evgen002/auth-dev

npm

Получает dev-токен и записывает его в .env проекта. Пока токен (JWT) действителен, повторный запрос не делается.

Установка

bun add -d @evgen002/auth-dev
# или
npm i -D @evgen002/auth-dev

Использование

Добавьте в .env проекта:

DEV_ENDPOINT=https://example.com/auth
DEV_LOGIN=login
DEV_PASSWORD=password

Запустите:

bunx auth-dev           # получить токен
bunx auth-dev --force   # обновить, даже если старый ещё действует

# или через npm
npx auth-dev
npx auth-dev --force

Переменные

| Переменная | По умолчанию | Описание | | ---------------- | -------------- | ----------------------------------------------- | | DEV_ENDPOINT | — | URL авторизации: POST { login, password } | | DEV_LOGIN | — | Логин | | DEV_PASSWORD | — | Пароль | | DEV_TOKEN_KEY | VITE_API_KEY | Куда записать токен, можно несколько через запятую | | DEV_TOKEN_PATH | token | Путь к токену в ответе, например data.accessToken | | DEV_TOKEN_SKEW | 300 | За сколько секунд до истечения обновлять токен | | DEV_TWO_FACTOR_ENDPOINT | — | URL подтверждения 2FA, вызывается после DEV_ENDPOINT | | DEV_TWO_FACTOR_CODE | — | Код 2FA, передаётся как ?two_factor_code=<код> |

Если заданы DEV_TWO_FACTOR_ENDPOINT и DEV_TWO_FACTOR_CODE, вход идёт в два шага: сначала POST { login, password } на DEV_ENDPOINT, затем с тем же телом на DEV_TWO_FACTOR_ENDPOINT?two_factor_code=<код>. Cookie из первого ответа передаются во второй запрос, токен берётся из второго ответа:

DEV_TWO_FACTOR_ENDPOINT=https://example.com/api/users/v1/main/auth
DEV_TWO_FACTOR_CODE=123456

Имя в DEV_TOKEN_KEY должно начинаться с префикса вашего сборщика: Vite — VITE_, Bun — BUN_PUBLIC_, Create React App — REACT_APP_, Next.js — NEXT_PUBLIC_. В webpack (dotenv-webpack) подойдёт любое имя.

Публикация новой версии

npm version minor        # или patch / major
git push --follow-tags
gh release create "$(git describe --tags --abbrev=0)" --generate-notes

GitHub Actions опубликует пакет в npm после создания релиза. Токены не нужны — используется Trusted Publishing: в настройках пакета на npmjs.com добавлен репозиторий EVGEN002/auth-dev и workflow publish.yml.