From b32ef230f0408b8c2cf2cc00038ceb2973a4637a Mon Sep 17 00:00:00 2001 From: David Brownman Date: Wed, 17 Sep 2025 18:13:50 -0700 Subject: [PATCH 1/2] support more npm tags --- .github/workflows/main.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c318f9545..694bff3316 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -124,13 +124,9 @@ jobs: npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN # print the NPM user name for validation npm whoami - VERSION=$(node -p "require('./package.json').version" ) - # Only publish stable versions to the latest tag - if [[ "$VERSION" =~ ^[^-]+$ ]]; then - NPM_TAG="latest" - else - NPM_TAG="beta" - fi + VERSION=$(< package.json | jq -r '.version') + # use the tag correlating to this release channel + NPM_TAG=$(< package.json | jq -r '.version | if contains("beta") then "public-preview" else if contains("alpha") then "private-preview" else "latest" end end') echo "Publishing $VERSION with $NPM_TAG tag." npm publish --otp="$(oathtool -b --totp $NPM_OTP)" --tag $NPM_TAG env: From 6d988ec3ec00e374c2bca94bc1376a061648aa17 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Wed, 17 Sep 2025 18:22:36 -0700 Subject: [PATCH 2/2] update docs --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ad41d3d7f7..31c707e6c4 100644 --- a/README.md +++ b/README.md @@ -525,13 +525,21 @@ const stripe = new Stripe('sk_test_...', { ### Public Preview SDKs -Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `15.2.0-beta.2`. +Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `18.6.0-beta.1`. We would love for you to try these as we incrementally release new features and improve them based on your feedback. -To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-node/releases/) and use it in the below command +The easiest way to install a public-preview release is to use the dedicated npm tag: ``` -npm install stripe@ --save +npm install stripe@public-preview --save +``` + +Or, to install a specific version from the [releases page](https://github.com/stripe/stripe-node/releases/), you can specify that version explicitly: + +``` +npm install stripe@ +# for example: +# npm install stripe@18.6.0-beta.1 ``` > **Note** @@ -547,7 +555,11 @@ const stripe = new Stripe('sk_test_...', { ### Private Preview SDKs -Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `15.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-node?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`. +Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `18.6.0-alpha.1`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-node?tab=readme-ov-file#public-preview-sdks) above and replacing the term `public-preview` with `private-preview`: + +``` +npm install stripe@private-preview --save +``` ### Custom requests