@monostate/browsernative-client 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -13
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 BNCA Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# @browsernative
|
|
1
|
+
# @monostate/browsernative-client
|
|
2
2
|
|
|
3
3
|
> **Official JavaScript/TypeScript client for Browser Native API**
|
|
4
4
|
|
|
5
|
-
[](https://badge.fury.io/js/%40monostate%2Fbrowsernative-client)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](../../LICENSE)
|
|
8
8
|
|
|
@@ -13,11 +13,11 @@ A lightweight, fast, and reliable client for the Browser Native web scraping and
|
|
|
13
13
|
### Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install @browsernative
|
|
16
|
+
npm install @monostate/browsernative-client
|
|
17
17
|
# or
|
|
18
|
-
yarn add @browsernative
|
|
18
|
+
yarn add @monostate/browsernative-client
|
|
19
19
|
# or
|
|
20
|
-
pnpm add @browsernative
|
|
20
|
+
pnpm add @monostate/browsernative-client
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Get Your API Key
|
|
@@ -29,7 +29,7 @@ pnpm add @browsernative/client
|
|
|
29
29
|
### Basic Usage
|
|
30
30
|
|
|
31
31
|
```javascript
|
|
32
|
-
import { BrowserNativeClient } from '@browsernative
|
|
32
|
+
import { BrowserNativeClient } from '@monostate/browsernative-client';
|
|
33
33
|
|
|
34
34
|
const client = new BrowserNativeClient('your-api-key');
|
|
35
35
|
|
|
@@ -46,7 +46,7 @@ console.log(screenshot.screenshot); // Base64 image
|
|
|
46
46
|
### Quick Functions
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
|
-
import { quickScrape, quickScreenshot, quickShot, quickAnalyze } from '@browsernative
|
|
49
|
+
import { quickScrape, quickScreenshot, quickShot, quickAnalyze } from '@monostate/browsernative-client';
|
|
50
50
|
|
|
51
51
|
// One-line scraping
|
|
52
52
|
const content = await quickScrape('https://example.com', 'your-api-key');
|
|
@@ -199,7 +199,7 @@ console.log(health.data.services); // Service status breakdown
|
|
|
199
199
|
```javascript
|
|
200
200
|
// hooks/useBrowserNative.js
|
|
201
201
|
import { useState } from 'react';
|
|
202
|
-
import { BrowserNativeClient } from '@browsernative
|
|
202
|
+
import { BrowserNativeClient } from '@monostate/browsernative-client';
|
|
203
203
|
|
|
204
204
|
export function useBrowserNative(apiKey) {
|
|
205
205
|
const [loading, setLoading] = useState(false);
|
|
@@ -235,7 +235,7 @@ export function useBrowserNative(apiKey) {
|
|
|
235
235
|
```javascript
|
|
236
236
|
// composables/useBrowserNative.js
|
|
237
237
|
import { ref } from 'vue';
|
|
238
|
-
import { BrowserNativeClient } from '@browsernative
|
|
238
|
+
import { BrowserNativeClient } from '@monostate/browsernative-client';
|
|
239
239
|
|
|
240
240
|
export function useBrowserNative(apiKey) {
|
|
241
241
|
const loading = ref(false);
|
|
@@ -270,7 +270,7 @@ export function useBrowserNative(apiKey) {
|
|
|
270
270
|
|
|
271
271
|
```javascript
|
|
272
272
|
// pages/api/scrape.js
|
|
273
|
-
import { BrowserNativeClient } from '@browsernative
|
|
273
|
+
import { BrowserNativeClient } from '@monostate/browsernative-client';
|
|
274
274
|
|
|
275
275
|
const client = new BrowserNativeClient(process.env.BROWSER_NATIVE_API_KEY);
|
|
276
276
|
|
|
@@ -300,7 +300,7 @@ export default async function handler(req, res) {
|
|
|
300
300
|
|
|
301
301
|
```javascript
|
|
302
302
|
import express from 'express';
|
|
303
|
-
import { BrowserNativeClient } from '@browsernative
|
|
303
|
+
import { BrowserNativeClient } from '@monostate/browsernative-client';
|
|
304
304
|
|
|
305
305
|
const app = express();
|
|
306
306
|
const client = new BrowserNativeClient(process.env.BROWSER_NATIVE_API_KEY);
|
|
@@ -342,7 +342,7 @@ You can use this client directly in browsers, but be careful with API keys:
|
|
|
342
342
|
</head>
|
|
343
343
|
<body>
|
|
344
344
|
<script type="module">
|
|
345
|
-
import { BrowserNativeClient } from 'https://cdn.skypack.dev/@browsernative
|
|
345
|
+
import { BrowserNativeClient } from 'https://cdn.skypack.dev/@monostate/browsernative-client';
|
|
346
346
|
|
|
347
347
|
// ⚠️ Never expose your API key in client-side code!
|
|
348
348
|
// Use a proxy server or environment variables
|
|
@@ -405,7 +405,7 @@ Common error scenarios:
|
|
|
405
405
|
Full TypeScript support with comprehensive type definitions:
|
|
406
406
|
|
|
407
407
|
```typescript
|
|
408
|
-
import { BrowserNativeClient, ScrapeResult, AnalyzeResult } from '@browsernative
|
|
408
|
+
import { BrowserNativeClient, ScrapeResult, AnalyzeResult } from '@monostate/browsernative-client';
|
|
409
409
|
|
|
410
410
|
const client: BrowserNativeClient = new BrowserNativeClient('your-api-key');
|
|
411
411
|
|
|
@@ -422,6 +422,23 @@ const analysis: AnalyzeResult = await client.analyze(url, question);
|
|
|
422
422
|
| **Pro** | 100,000 | 300/minute |
|
|
423
423
|
| **Enterprise** | Unlimited | Custom |
|
|
424
424
|
|
|
425
|
+
## 📋 Changelog
|
|
426
|
+
|
|
427
|
+
### v1.2.0 (Latest)
|
|
428
|
+
- 🔧 **Timeout Improvements**: Enhanced timeout handling and request reliability
|
|
429
|
+
- 📝 **Documentation Updates**: Comprehensive API documentation and examples
|
|
430
|
+
- 🏷️ **Package Naming**: Proper package name consistency across all imports
|
|
431
|
+
- ⚡ **Performance Optimizations**: Better error handling and response processing
|
|
432
|
+
- 🌐 **Framework Integration**: Improved React, Vue, and Next.js examples
|
|
433
|
+
|
|
434
|
+
### v1.1.2
|
|
435
|
+
- Bug fixes and stability improvements
|
|
436
|
+
- Enhanced error handling
|
|
437
|
+
|
|
438
|
+
### v1.1.1
|
|
439
|
+
- Initial TypeScript support
|
|
440
|
+
- Basic API client functionality
|
|
441
|
+
|
|
425
442
|
## 🤝 Support
|
|
426
443
|
|
|
427
444
|
- 📧 **Email**: [support@bnca.monostate.ai](mailto:support@bnca.monostate.ai)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monostate/browsernative-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Browser Native client SDK for web scraping and content extraction API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/browsernative
|
|
40
|
+
"url": "git+https://github.com/monostate/browsernative-client.git"
|
|
41
41
|
},
|
|
42
42
|
"bugs": {
|
|
43
|
-
"url": "https://github.com/browsernative
|
|
43
|
+
"url": "https://github.com/monostate/browsernative-client/issues"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://bnca.monostate.ai",
|
|
46
46
|
"publishConfig": {
|