n8n-nodes-surface 0.1.2 → 0.1.4
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/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Surface by Canada Site Ops. Ontario, Canada.
|
|
|
8
8
|
|
|
9
9
|
## Get a free API key in about 10 seconds
|
|
10
10
|
|
|
11
|
-
No email, no card. Then paste the key into the **Surface API** credential (`apiKey`)
|
|
11
|
+
No email, no card. Then paste the key into the **Surface API** credential (`apiKey`), or set `SURFACE_KEY` / `SURFACE_API_KEY` in the n8n environment. The node sends it as `Authorization: Bearer <key>`.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
curl -s -X POST https://nova-otter-delta-cloud.grok.me/v1/keys
|
|
@@ -17,6 +17,15 @@ curl -s -X POST https://nova-otter-delta-cloud.grok.me/v1/keys
|
|
|
17
17
|
|
|
18
18
|
A key gets its own million free requests a month. The node also runs without a key on a shared demo limit.
|
|
19
19
|
|
|
20
|
+
## Check a link with the key you just minted
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @surfaceapi/surface init
|
|
24
|
+
npx @surfaceapi/surface preflight https://youtu.be/jNQXAC9IVRw
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The first command writes `.env`. The second reads that key and calls `POST /v1/preflight`. The answer is `fetch` or `skip`.
|
|
28
|
+
|
|
20
29
|
## Install
|
|
21
30
|
|
|
22
31
|
In n8n: **Settings → Community Nodes → Install** → `n8n-nodes-surface`.
|
|
@@ -37,5 +46,3 @@ Mint a key first, then point any MCP client at `https://nova-otter-delta-cloud.g
|
|
|
37
46
|
- https://www.npmjs.com/package/@surfaceapi/surface
|
|
38
47
|
- https://pypi.org/project/surfaceapi/
|
|
39
48
|
- https://huggingface.co/spaces/surfaceapi/surface-preflight
|
|
40
|
-
|
|
41
|
-
CLI and GitHub Action are coming soon.
|
|
@@ -35,8 +35,9 @@ class SurfacePreflight {
|
|
|
35
35
|
const url = this.getNodeParameter("url", i);
|
|
36
36
|
const skipOnError = this.getNodeParameter("skipOnError", i, true);
|
|
37
37
|
try {
|
|
38
|
-
const headers = { "content-type": "application/json", accept: "application/json", "user-agent": "n8n-nodes-surface/0.1.
|
|
39
|
-
|
|
38
|
+
const headers = { "content-type": "application/json", accept: "application/json", "user-agent": "n8n-nodes-surface/0.1.3" };
|
|
39
|
+
const key = creds.apiKey || process.env.SURFACE_KEY || process.env.SURFACE_API_KEY;
|
|
40
|
+
if (key) headers.authorization = "Bearer " + key;
|
|
40
41
|
if (process.env.SURFACE_INTERNAL === "1") headers["X-Surface-Internal"] = "1";
|
|
41
42
|
const d = await this.helpers.httpRequest({ method: "POST", url: base + "/v1/preflight", headers, body: { url }, json: true, timeout: 15000 });
|
|
42
43
|
const next = d.next || d.verdict;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-surface",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Surface checks a short link before your agent opens it. The answer is fetch or skip. It never returns the page. n8n Surface Preflight node. Free for the first million requests a month.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|