Skip to content

Commit 498a0bd

Browse files
stainless-app[bot]samfinton
andauthored
release: 3.21.0 (#17)
* feat(client): improve logging Logging is now: 1. Streaming 4. Configurable in-memory 5. Generally more robust 6. Usable with any underlying http client * codegen metadata * codegen metadata * feat: [feat]: add `ignoreSelectors` to `observe()` * chore: redact api-key headers in debug logs * ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. * feat: STG-1756 add Vertex auth params to Stagehand spec * feat: Add `screenshot` option to Extract * feat: [STG-1756] forward Vertex model config * fix(java): update model config examples * release: 3.21.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: samfinton <samfinton@samLaptopm5.local>
1 parent 1ff82f3 commit 498a0bd

35 files changed

Lines changed: 24589 additions & 960 deletions

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2323

2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2626

2727
- name: Set up Java
28-
uses: actions/setup-java@v5
28+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2929
with:
3030
distribution: temurin
3131
java-version: |
@@ -34,7 +34,7 @@ jobs:
3434
cache: gradle
3535

3636
- name: Set up Gradle
37-
uses: gradle/actions/setup-gradle@v4
37+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
3838

3939
- name: Run lints
4040
run: ./scripts/lint
@@ -49,10 +49,10 @@ jobs:
4949
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
5050

5151
steps:
52-
- uses: actions/checkout@v6
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5353

5454
- name: Set up Java
55-
uses: actions/setup-java@v5
55+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
5656
with:
5757
distribution: temurin
5858
java-version: |
@@ -61,7 +61,7 @@ jobs:
6161
cache: gradle
6262

6363
- name: Set up Gradle
64-
uses: gradle/actions/setup-gradle@v4
64+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
6565

6666
- name: Build SDK
6767
run: ./scripts/build
@@ -71,7 +71,7 @@ jobs:
7171
github.repository == 'stainless-sdks/stagehand-java' &&
7272
!startsWith(github.ref, 'refs/heads/stl/')
7373
id: github-oidc
74-
uses: actions/github-script@v8
74+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
7575
with:
7676
script: core.setOutput('github_token', await core.getIDToken());
7777

@@ -91,10 +91,10 @@ jobs:
9191
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
9292
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
9393
steps:
94-
- uses: actions/checkout@v6
94+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9595

9696
- name: Set up Java
97-
uses: actions/setup-java@v5
97+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
9898
with:
9999
distribution: temurin
100100
java-version: |
@@ -103,7 +103,7 @@ jobs:
103103
cache: gradle
104104

105105
- name: Set up Gradle
106-
uses: gradle/gradle-build-action@v2
106+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
107107

108108
- name: Run tests
109109
run: ./scripts/test

.github/workflows/publish-sonatype.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

1919
- name: Set up Java
20-
uses: actions/setup-java@v5
20+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2121
with:
2222
distribution: temurin
2323
java-version: |
@@ -26,7 +26,7 @@ jobs:
2626
cache: gradle
2727

2828
- name: Set up Gradle
29-
uses: gradle/gradle-build-action@v2
29+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
3030

3131
- name: Publish to Sonatype
3232
run: |-

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.repository == 'browserbase/stagehand-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1313

1414
steps:
15-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616

1717
- name: Check release environment
1818
run: |

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.20.0"
2+
".": "3.21.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-6f6bfb81d092f30a5e2005328c97d61b9ea36132bb19e9e79e55294b9534ce20.yml
3-
openapi_spec_hash: f3fc1e3688a38dc2c28f7178f7d534e5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-c7910965e66e73ad8b65b6cc391d431094b2a6c6577c3e9d82feaa8138e74cff.yml
3+
openapi_spec_hash: 37748bb69c22a9ce721d9b5a5861f964
44
config_hash: 1fb12ae9b478488bc1e56bfbdc210b01

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## 3.21.0 (2026-05-29)
4+
5+
Full Changelog: [v3.20.0...v3.21.0](https://github.com/browserbase/stagehand-java/compare/v3.20.0...v3.21.0)
6+
7+
### Features
8+
9+
* [feat]: add `ignoreSelectors` to `observe()` ([aa7ad0c](https://github.com/browserbase/stagehand-java/commit/aa7ad0c2033478107f3944b625d1b172b8f39e83))
10+
* [STG-1756] forward Vertex model config ([b37b827](https://github.com/browserbase/stagehand-java/commit/b37b827f38cc168d12e0d3a355f25a137796f5d7))
11+
* Add `screenshot` option to Extract ([043d138](https://github.com/browserbase/stagehand-java/commit/043d138a98a8caab6bc2c59c2abb0a864019c3c5))
12+
* **client:** improve logging ([1d84566](https://github.com/browserbase/stagehand-java/commit/1d845661917baf3d12a97286cf760e0d0fda0218))
13+
* STG-1756 add Vertex auth params to Stagehand spec ([f072067](https://github.com/browserbase/stagehand-java/commit/f072067e7adef04886423e1232e6b7e42e5f8a28))
14+
15+
16+
### Bug Fixes
17+
18+
* **java:** update model config examples ([991a894](https://github.com/browserbase/stagehand-java/commit/991a894f6c93371eaf18a5878a41a4e27928adc8))
19+
20+
21+
### Chores
22+
23+
* redact api-key headers in debug logs ([ce7e1d2](https://github.com/browserbase/stagehand-java/commit/ce7e1d278d5f7a9ceda6bc3108ed8d097f9b313d))
24+
325
## 3.20.0 (2026-05-06)
426

527
Full Changelog: [v3.19.3...v3.20.0](https://github.com/browserbase/stagehand-java/compare/v3.19.3...v3.20.0)

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/stagehand-java)](https://central.sonatype.com/artifact/com.browserbase.api/stagehand-java/3.20.0)
6-
[![javadoc](https://javadoc.io/badge2/com.browserbase.api/stagehand-java/3.20.0/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/stagehand-java/3.20.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/stagehand-java)](https://central.sonatype.com/artifact/com.browserbase.api/stagehand-java/3.21.0)
6+
[![javadoc](https://javadoc.io/badge2/com.browserbase.api/stagehand-java/3.21.0/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/stagehand-java/3.21.0)
77

88
<!-- x-release-please-end -->
99

@@ -85,7 +85,7 @@ Most existing browser automation tools either require you to write low-level cod
8585
### Gradle
8686

8787
```kotlin
88-
implementation("com.browserbase.api:stagehand-java:3.20.0")
88+
implementation("com.browserbase.api:stagehand-java:3.21.0")
8989
```
9090

9191
### Maven
@@ -94,7 +94,7 @@ implementation("com.browserbase.api:stagehand-java:3.20.0")
9494
<dependency>
9595
<groupId>com.browserbase.api</groupId>
9696
<artifactId>stagehand-java</artifactId>
97-
<version>3.20.0</version>
97+
<version>3.21.0</version>
9898
</dependency>
9999
```
100100

@@ -526,8 +526,6 @@ The SDK throws custom unchecked exception types:
526526

527527
## Logging
528528

529-
The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).
530-
531529
Enable logging by setting the `STAGEHAND_LOG` environment variable to `info`:
532530

533531
```sh
@@ -540,6 +538,19 @@ Or to `debug` for more verbose logging:
540538
export STAGEHAND_LOG=debug
541539
```
542540

541+
Or configure the client manually using the `logLevel` method:
542+
543+
```java
544+
import com.browserbase.api.client.StagehandClient;
545+
import com.browserbase.api.client.okhttp.StagehandOkHttpClient;
546+
import com.browserbase.api.core.LogLevel;
547+
548+
StagehandClient client = StagehandOkHttpClient.builder()
549+
.fromEnv()
550+
.logLevel(LogLevel.INFO)
551+
.build();
552+
```
553+
543554
## ProGuard and R8
544555

545556
Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `stagehand-java-core` is published with a [configuration file](stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "com.browserbase.api"
11-
version = "3.20.0" // x-release-please-version
11+
version = "3.21.0" // x-release-please-version
1212
}
1313

1414
subprojects {

stagehand-java-client-okhttp/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies {
77
api(project(":stagehand-java-core"))
88

99
implementation("com.squareup.okhttp3:okhttp:4.12.0")
10-
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
1110

1211
testImplementation(kotlin("test"))
1312
testImplementation("org.assertj:assertj-core:3.27.7")

stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import okhttp3.Request
3535
import okhttp3.RequestBody
3636
import okhttp3.RequestBody.Companion.toRequestBody
3737
import okhttp3.Response
38-
import okhttp3.logging.HttpLoggingInterceptor
3938
import okio.BufferedSink
4039
import okio.buffer
4140
import okio.sink
@@ -93,21 +92,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie
9392
private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call {
9493
val clientBuilder = okHttpClient.newBuilder()
9594

96-
val logLevel =
97-
when (System.getenv("STAGEHAND_LOG")?.lowercase()) {
98-
"info" -> HttpLoggingInterceptor.Level.BASIC
99-
"debug" -> HttpLoggingInterceptor.Level.BODY
100-
else -> null
101-
}
102-
if (logLevel != null) {
103-
clientBuilder.addNetworkInterceptor(
104-
HttpLoggingInterceptor().setLevel(logLevel).apply {
105-
redactHeader("x-bb-api-key")
106-
redactHeader("x-model-api-key")
107-
}
108-
)
109-
}
110-
11195
requestOptions.timeout?.let {
11296
clientBuilder
11397
.connectTimeout(it.connect())

0 commit comments

Comments
 (0)