[GH-ISSUE #6261] Please migrate to npm trusted publishing #27787

Closed
opened 2026-04-17 19:00:04 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @tnkuehne on GitHub (Nov 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6261

After recent compromises of npm packages (e.g., Posthog), due to token compromises. I would highly appreciate better-auth to switch to trusted publishing (https://docs.npmjs.com/trusted-publishers), to mitigate this risk. Fairly large packages, like Svelte, have already made the move.

Originally created by @tnkuehne on GitHub (Nov 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6261 After recent compromises of npm packages (e.g., Posthog), due to token compromises. I would highly appreciate better-auth to switch to trusted publishing (https://docs.npmjs.com/trusted-publishers), to mitigate this risk. Fairly large packages, like Svelte, have already made the move.
GiteaMirror added the locked label 2026-04-17 19:00:04 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 24, 2025):

Thank you for opening this issue and for raising the security concerns regarding npm package token compromises. We understand the importance of migrating to a trusted publishing workflow to better protect our packages, and our team is currently evaluating the steps needed to transition our publishing process in line with npm’s trusted publishing guidelines. In the meantime, we recommend keeping an eye on our release notes for updates related to this change, as we strive to continuously improve our security practices.

Do you have any specific concerns or scenarios that you'd like us to address as part of this migration? tag @better-auth-agent if you would like an answer from the Agent

Diagram • Discord • GitHub

Diagram Join Star

<!-- gh-comment-id:3570630262 --> @better-auth-agent[bot] commented on GitHub (Nov 24, 2025): Thank you for opening this issue and for raising the security concerns regarding npm package token compromises. We understand the importance of migrating to a trusted publishing workflow to better protect our packages, and our team is currently evaluating the steps needed to transition our publishing process in line with npm’s trusted publishing guidelines. In the meantime, we recommend keeping an eye on our release notes for updates related to this change, as we strive to continuously improve our security practices. Do you have any specific concerns or scenarios that you'd like us to address as part of this migration? tag @better-auth-agent if you would like an answer from the Agent <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@himself65 commented on GitHub (Nov 24, 2025):

Yes, we will do that!

<!-- gh-comment-id:3572088955 --> @himself65 commented on GitHub (Nov 24, 2025): Yes, we will do that!
Author
Owner

@tnkuehne commented on GitHub (Nov 24, 2025):

@himself65 thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token.

You probably already know that, just wanted to make sure :)

<!-- gh-comment-id:3572166527 --> @tnkuehne commented on GitHub (Nov 24, 2025): @himself65 thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token. You probably already know that, just wanted to make sure :)
Author
Owner

@himself65 commented on GitHub (Nov 24, 2025):

We have this in 1.4.2-beta.4

<!-- gh-comment-id:3572196614 --> @himself65 commented on GitHub (Nov 24, 2025): We have this in 1.4.2-beta.4
Author
Owner

@himself65 commented on GitHub (Nov 24, 2025):

@himself65 thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token.

You probably already know that, just wanted to make sure :)

So I can remove the NPM token from the environment? Could you please open a PR to fix that? thx

<!-- gh-comment-id:3572199559 --> @himself65 commented on GitHub (Nov 24, 2025): > [@himself65](https://github.com/himself65) thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token. > > You probably already know that, just wanted to make sure :) So I can remove the NPM token from the environment? Could you please open a PR to fix that? thx
Author
Owner

@tnkuehne commented on GitHub (Nov 24, 2025):

@himself65 thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token.

You probably already know that, just wanted to make sure :)

So I can remove the NPM token from the environment?

Yes! That's the point of trusted publishing.

Could you please open a PR to fix that? thx

but I can't fix this with a PR as it would just remove the NPM token, the rest of the GitHub action already has everything needed for trusted publishing. But the important thing is to configure NPM as outlined in this guide https://docs.npmjs.com/trusted-publishers#step-1-add-a-trusted-publisher-on-npmjscom

<!-- gh-comment-id:3572293620 --> @tnkuehne commented on GitHub (Nov 24, 2025): > > [@himself65](https://github.com/himself65) thanks for acting so quickly. Provenance is a good first step, but not the same as trusted publishing. You are still currently using an npm token for publishing. However, trusted publishing enables you to publish without an npm token by linking the GitHub action to the packages, thereby eliminating the attack vector of a compromised npm token. > > > > You probably already know that, just wanted to make sure :) > > So I can remove the NPM token from the environment? Yes! That's the point of trusted publishing. > Could you please open a PR to fix that? thx but I can't fix this with a PR as it would just remove the NPM token, the rest of the GitHub action already has everything needed for trusted publishing. But the important thing is to configure NPM as outlined in this guide https://docs.npmjs.com/trusted-publishers#step-1-add-a-trusted-publisher-on-npmjscom
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27787