@metalift/sdk
Advanced tools
+61
| # @metalift/sdk | ||
| Official TypeScript/JavaScript SDK for [Metalift](https://app.metalift.ai) — turn any URL into agent-ready markdown, HTML, or structured data. | ||
| ## Requirements | ||
| - **Node.js 20+** | ||
| - **ESM only** — use `import`, not `require()` | ||
| ## Install | ||
| ```bash | ||
| npm install @metalift/sdk | ||
| ``` | ||
| ## Quick start | ||
| ```javascript | ||
| import Metalift from "@metalift/sdk"; | ||
| const client = new Metalift({ apiKey: "YOUR_API_KEY" }); | ||
| const result = await client.scrape({ | ||
| url: "https://example.com", | ||
| formats: ["markdown"], | ||
| }); | ||
| console.log(result.data.markdown); | ||
| ``` | ||
| Get an API key from the [Metalift dashboard](https://app.metalift.ai/dashboard/keys). | ||
| ## Configuration | ||
| ```javascript | ||
| import Metalift from "@metalift/sdk"; | ||
| const client = new Metalift({ | ||
| apiUrl: "https://api.metalift.ai", // default | ||
| apiKey: process.env.METALIFT_API_KEY, | ||
| }); | ||
| ``` | ||
| | Variable | Description | | ||
| |----------|-------------| | ||
| | `METALIFT_API_URL` | API base URL (default: `https://api.metalift.ai`) | | ||
| | `METALIFT_API_KEY` | Bearer token for authenticated requests | | ||
| ## CommonJS projects | ||
| This package is ESM-only. In CommonJS projects, use dynamic import: | ||
| ```javascript | ||
| const { default: Metalift } = await import("@metalift/sdk"); | ||
| ``` | ||
| Or add `"type": "module"` to your `package.json`, or use `.mjs` entry files. | ||
| ## Links | ||
| - [Documentation](https://app.metalift.ai/docs) | ||
| - [Support](mailto:support@metalift.ai) |
+1
-1
@@ -5,3 +5,3 @@ export class Metalift { | ||
| constructor(config = {}) { | ||
| this.apiUrl = (config.apiUrl || process.env.METALIFT_API_URL || "http://localhost:8080").replace(/\/$/, ""); | ||
| this.apiUrl = (config.apiUrl || process.env.METALIFT_API_URL || "https://api.metalift.ai").replace(/\/$/, ""); | ||
| this.apiKey = config.apiKey || process.env.METALIFT_API_KEY; | ||
@@ -8,0 +8,0 @@ } |
+6
-7
| { | ||
| "name": "@metalift/sdk", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Metalift TypeScript SDK", | ||
@@ -11,8 +11,5 @@ "license": "SEE LICENSE IN LICENSE", | ||
| "build": "tsc", | ||
| "prepublishOnly": "npm run build" | ||
| "prepublishOnly": "npm run build && node ../../scripts/npm-prepare-publish.mjs strip", | ||
| "postpublish": "node ../../scripts/npm-prepare-publish.mjs restore" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^22.10.2", | ||
| "typescript": "^5.7.2" | ||
| }, | ||
| "engines": { | ||
@@ -28,3 +25,5 @@ "node": ">=20" | ||
| "files": [ | ||
| "dist" | ||
| "dist", | ||
| "README.md", | ||
| "LICENSE" | ||
| ], | ||
@@ -31,0 +30,0 @@ "repository": { |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
8712
20.17%0
-100%5
25%0
-100%62
Infinity%3
50%