diff --git a/.fernignore b/.fernignore index 5ff5d16..18815d2 100644 --- a/.fernignore +++ b/.fernignore @@ -1,6 +1,6 @@ # Specify files that shouldn't be modified by Fern src/wrapper/ -test/wrapper/ +tests/wrapper/ src/index.ts examples/ .vscode/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f884ee..9424323 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,30 @@ jobs: - 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 }} \ No newline at end of file diff --git a/README.md b/README.md index 3df6d80..19e46c6 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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({ @@ -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 = { ... @@ -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(...); @@ -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({ ... diff --git a/package.json b/package.json index c0b9697..2cc5ae5 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Client.ts b/src/Client.ts index b60c9f8..ac4d707 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -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, }, diff --git a/src/version.ts b/src/version.ts index 2eb2a2f..b415026 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "0.0.40"; +export const SDK_VERSION = "1.2.1";