Skip to content

Commit eb26458

Browse files
authored
Merge pull request #23 from browserbase/release-please--branches--main--changes--next--components--sdk
release: 0.1.0-alpha.3
2 parents f5ad92d + 053855b commit eb26458

36 files changed

+172
-91
lines changed

.release-please-manifest.json

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

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-9f93c744538f57747ea1385817e21b40c318b65ebc155dca8950268beb280bc9.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b341dd9d5bb77c4f217b94b186763e730fd798fbb773a5e90bb4e2a8d4a2c822.yml

CHANGELOG.md

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

3+
## 0.1.0-alpha.3 (2024-10-29)
4+
5+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/browserbase/sdk-node/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
6+
7+
### Features
8+
9+
* **api:** api update ([#19](https://github.com/browserbase/sdk-node/issues/19)) ([8df9cc8](https://github.com/browserbase/sdk-node/commit/8df9cc8c76e4a615ba63d4568086bd60e88a0dfb))
10+
11+
12+
### Chores
13+
14+
* update SDK settings ([#21](https://github.com/browserbase/sdk-node/issues/21)) ([dd2956f](https://github.com/browserbase/sdk-node/commit/dd2956f0b22aac232b6ae3cdd572a4d6b688099d))
15+
316
## 0.1.0-alpha.2 (2024-10-28)
417

518
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/browserbase/sdk-node/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ $ cd sdk-node
5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link browserbase
58+
$ yarn link @browserbasehq/sdk
5959

6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -—global browserbase
63+
$ pnpm link -—global @browserbasehq/sdk
6464
```
6565

6666
## Running tests

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Browserbase Node API Library
22

3-
[![NPM version](https://img.shields.io/npm/v/browserbase.svg)](https://npmjs.org/package/browserbase) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/browserbase)
3+
[![NPM version](https://img.shields.io/npm/v/@browserbasehq/sdk.svg)](https://npmjs.org/package/@browserbasehq/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@browserbasehq/sdk)
44

55
This library provides convenient access to the Browserbase REST API from server-side TypeScript or JavaScript.
66

@@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://[email protected]:browserbase/sdk-node.git
14+
npm install @browserbasehq/sdk
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install browserbase`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).
2320

2421
<!-- prettier-ignore -->
2522
```js
26-
import Browserbase from 'browserbase';
23+
import Browserbase from '@browserbasehq/sdk';
2724

2825
const client = new Browserbase({
2926
apiKey: process.env['BROWSERBASE_API_KEY'], // This is the default and can be omitted
@@ -44,7 +41,7 @@ This library includes TypeScript definitions for all request params and response
4441

4542
<!-- prettier-ignore -->
4643
```ts
47-
import Browserbase from 'browserbase';
44+
import Browserbase from '@browserbasehq/sdk';
4845

4946
const client = new Browserbase({
5047
apiKey: process.env['BROWSERBASE_API_KEY'], // This is the default and can be omitted
@@ -218,11 +215,11 @@ add the following import before your first import `from "Browserbase"`:
218215
```ts
219216
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
220217
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
221-
import 'browserbase/shims/web';
222-
import Browserbase from 'browserbase';
218+
import '@browserbasehq/sdk/shims/web';
219+
import Browserbase from '@browserbasehq/sdk';
223220
```
224221

225-
To do the inverse, add `import "browserbase/shims/node"` (which does import polyfills).
222+
To do the inverse, add `import "@browserbasehq/sdk/shims/node"` (which does import polyfills).
226223
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/browserbase/sdk-node/tree/main/src/_shims#readme)).
227224

228225
### Logging and middleware
@@ -232,7 +229,7 @@ which can be used to inspect or alter the `Request` or `Response` before/after e
232229

233230
```ts
234231
import { fetch } from 'undici'; // as one example
235-
import Browserbase from 'browserbase';
232+
import Browserbase from '@browserbasehq/sdk';
236233

237234
const client = new Browserbase({
238235
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {

jest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const config: JestConfigWithTsJest = {
77
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
88
},
99
moduleNameMapper: {
10-
'^browserbase$': '<rootDir>/src/index.ts',
11-
'^browserbase/_shims/auto/(.*)$': '<rootDir>/src/_shims/auto/$1-node',
12-
'^browserbase/(.*)$': '<rootDir>/src/$1',
10+
'^@browserbasehq/sdk$': '<rootDir>/src/index.ts',
11+
'^@browserbasehq/sdk/_shims/auto/(.*)$': '<rootDir>/src/_shims/auto/$1-node',
12+
'^@browserbasehq/sdk/(.*)$': '<rootDir>/src/$1',
1313
},
1414
modulePathIgnorePatterns: [
1515
'<rootDir>/ecosystem-tests/',

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "browserbase",
3-
"version": "0.1.0-alpha.2",
2+
"name": "@browserbasehq/sdk",
3+
"version": "0.1.0-alpha.3",
44
"description": "The official TypeScript library for the Browserbase API",
55
"author": "Browserbase <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -67,8 +67,8 @@
6767
"./shims/web.mjs"
6868
],
6969
"imports": {
70-
"browserbase": ".",
71-
"browserbase/*": "./src/*"
70+
"@browserbasehq/sdk": ".",
71+
"@browserbasehq/sdk/*": "./src/*"
7272
},
7373
"exports": {
7474
"./_shims/auto/*": {

scripts/build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs
88

99
# Build into dist and will publish the package from there,
1010
# so that src/resources/foo.ts becomes <package root>/resources/foo.js
11-
# This way importing from `"browserbase/resources/foo"` works
11+
# This way importing from `"@browserbasehq/sdk/resources/foo"` works
1212
# even with `"moduleResolution": "node"`
1313

1414
rm -rf dist; mkdir dist
@@ -47,8 +47,8 @@ node scripts/utils/postprocess-files.cjs
4747

4848
# make sure that nothing crashes when we require the output CJS or
4949
# import the output ESM
50-
(cd dist && node -e 'require("browserbase")')
51-
(cd dist && node -e 'import("browserbase")' --input-type=module)
50+
(cd dist && node -e 'require("@browserbasehq/sdk")')
51+
(cd dist && node -e 'import("@browserbasehq/sdk")' --input-type=module)
5252

5353
if command -v deno &> /dev/null && [ -e ./scripts/build-deno ]
5454
then

scripts/utils/postprocess-files.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33
const { parse } = require('@typescript-eslint/parser');
44

5-
const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'browserbase/';
5+
const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? '@browserbasehq/sdk/';
66

77
const distDir =
88
process.env['DIST_PATH'] ?
@@ -142,7 +142,7 @@ async function postprocess() {
142142

143143
if (file.endsWith('.d.ts')) {
144144
// work around bad tsc behavior
145-
// if we have `import { type Readable } from 'browserbase/_shims/index'`,
145+
// if we have `import { type Readable } from '@browserbasehq/sdk/_shims/index'`,
146146
// tsc sometimes replaces `Readable` with `import("stream").Readable` inline
147147
// in the output .d.ts
148148
transformed = transformed.replace(/import\("stream"\).Readable/g, 'Readable');

0 commit comments

Comments
 (0)