Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,30 @@

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
if [[ ${GITHUB_REF} == *alpha* ]]; then
npm publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
npm publish --access public --tag beta
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Comment on lines +33 to +57

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 18 days ago

To fix this problem, add an explicit permissions: section to the workflow file at either the workflow root level (applies to all jobs by default) or to specific jobs. The safest minimal starting point is to set contents: read at the root, ensuring all jobs only receive read access unless overridden. If any job (e.g., publish) needs more extensive permissions (write to repository contents, pull requests, or packages), add a more specific permissions: block to that job only. In this case, since none of the jobs require write access to repository contents (NPM publish uses an NPM token, not GITHUB_TOKEN), it is safe to apply contents: read at the root. Place the following permissions block at the top of the workflow file, just under the workflow name: and before on:.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: ci
+permissions:
+  contents: read
 
 on: [push]
 
EOF
@@ -1,4 +1,6 @@
name: ci
permissions:
contents: read

on: [push]

Copilot is powered by AI and may make mistakes. Always verify output.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BrowserUse TypeScript Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fbrowser-use%2Fbrowser-use-node)
[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/)
[![npm shield](https://img.shields.io/npm/v/browser-use-sdk)](https://www.npmjs.com/package/browser-use-sdk)

The BrowserUse TypeScript library provides convenient access to the BrowserUse APIs from TypeScript.

Expand Down Expand Up @@ -403,7 +403,7 @@ On the other hand, contributions to the README are always very welcome!
## Installation

```sh
npm i -s
npm i -s browser-use-sdk
```

## Reference
Expand All @@ -415,7 +415,7 @@ A full reference for this library is available [here](https://github.com/browser
Instantiate and use the client with the following:

```typescript
import { BrowserUseClient } from "";
import { BrowserUseClient } from "browser-use-sdk";

const client = new BrowserUseClient({ apiKey: "YOUR_API_KEY" });
await client.tasks.createTask({
Expand All @@ -429,7 +429,7 @@ The SDK exports all request and response types as TypeScript interfaces. Simply
following namespace:

```typescript
import { BrowserUse } from "BrowserUse";
import { BrowserUse } from "browser-use-sdk";

const request: BrowserUse.ListTasksTasksGetRequest = {
...
Expand All @@ -442,7 +442,7 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
will be thrown.

```typescript
import { BrowserUseError } from "BrowserUse";
import { BrowserUseError } from "browser-use-sdk";

try {
await client.tasks.createTask(...);
Expand Down Expand Up @@ -553,7 +553,7 @@ The SDK provides a way for you to customize the underlying HTTP client / Fetch f
unsupported environment, this provides a way for you to break glass and ensure the SDK works.

```typescript
import { BrowserUseClient } from "BrowserUse";
import { BrowserUseClient } from "browser-use-sdk";

const client = new BrowserUseClient({
...
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "",
"version": "0.0.40",
"name": "browser-use-sdk",
"version": "1.2.1",
"private": false,
"repository": "github:browser-use/browser-use-node",
"type": "commonjs",
Expand Down
5 changes: 3 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ export class BrowserUseClient {
headers: mergeHeaders(
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "",
"X-Fern-SDK-Version": "0.0.40",
"X-Fern-SDK-Name": "browser-use-sdk",
"X-Fern-SDK-Version": "1.2.1",
"User-Agent": "browser-use-sdk/1.2.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = "0.0.40";
export const SDK_VERSION = "1.2.1";
114 changes: 0 additions & 114 deletions tests/wrapper/webhooks.test.ts

This file was deleted.

Loading