Cookie EditorCookie Editor
All guides

Documentation

Use with n8n

The n8n integration lets workflows fetch cookies from your browser over HTTP — no manual export required. The encryption password is stored only in the extension; the server never receives it.

Architecture

n8n ──HTTP GET──► Cookie Editor Server ──WebSocket──► Extension ──► chrome.cookies
                        │                                    │
                        └──── encrypted data ◄───────────────┘
n8n decrypts with the password you configured

Step 1: Open the n8n tab

  1. Open the Cookie Editor side panel.
  2. Click the n8n icon in the right sidebar.
  3. The extension opens a dedicated n8n.html tab.
n8n tab — disconnected state with Connect button
n8n tab — disconnected state with Connect button

Step 2: Connect the extension to the server

  1. Click Connect.
  2. Grant storage and alarms permissions if prompted.
  3. Enter an encryption password in the Connect modal.
    • This password is not sent to the server.
    • It is stored locally in the extension — use the same value when decrypting in n8n.
  4. The extension opens a WebSocket to wss://cookieeditor.org/ws/n8n (dev: ws://localhost:3000/ws/n8n).
  5. The server returns a client_key like ck_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Connected n8n tab — client_key displayed, Disconnect and View usage buttons
Connected n8n tab — client_key displayed, Disconnect and View usage buttons

Step 3: Copy client_key

After a successful connection, copy the client_key shown on screen. Use it in every API request from n8n.

The Usage / View usage tab in the extension includes ready-made fetch, curl, and n8n Function examples.

Step 4: Call the API from n8n

HTTP Request node

Method: GET
URL: https://cookieeditor.org/api/n8n/cookies
Query:
  client_key: {{ $env.COOKIE_EDITOR_CLIENT_KEY }}
  url: https://example.com

curl

curl "https://cookieeditor.org/api/n8n/cookies?client_key=ck_YOUR_KEY&url=https://example.com"

fetch (JavaScript)

const res = await fetch(
  "https://cookieeditor.org/api/n8n/cookies?client_key=ck_YOUR_KEY&url=https://example.com"
);
const json = await res.json();
// json.data = AES-encrypted cookie string

Success response

{
  "success": true,
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "client_key": "ck_...",
  "url": "https://example.com",
  "domain": "example.com",
  "data": "U2FsdGVkX1+..."
}

Step 5: Decrypt in n8n

Add a Function node after the HTTP Request:

const CryptoJS = require('crypto-js');

const encrypted = $input.first().json.data;
const password = $env.COOKIE_EDITOR_PASSWORD; // same password as Connect

const decryptedBase64 = CryptoJS.AES.decrypt(encrypted, password)
  .toString(CryptoJS.enc.Utf8);

if (!decryptedBase64) {
  throw new Error('Decryption failed — wrong password?');
}

const cookies = JSON.parse(atob(decryptedBase64));

return cookies.map((cookie) => ({ json: cookie }));

Install the crypto-js package in n8n if needed. The password must match what you entered when connecting the extension.

What happens when n8n calls the API

  1. n8n sends GET /api/n8n/cookies?client_key&url
  2. The server finds the WebSocket session by client_key
  3. The server sends { type: "get_cookies", request_id, url } to the extension
  4. Extension: chrome.cookies.getAll({ url }) → AES encrypt → sends cookies_result
  5. The server returns encrypted data to n8n
  6. n8n decrypts with your password

Request history

The extension stores up to 50 recent requests in the n8n tab (local only):

  • Domain, URL, time, status, cookie count, error message
  • Clear history with the Clear history button
Request history table in the n8n tab — domain, url, status, cookie count
Request history table in the n8n tab — domain, url, status, cookie count

Disconnect

Click Disconnect on the n8n tab:

  • The extension sends { type: "disconnect" } and closes the WebSocket
  • The server removes the session — the old client_key stops working
  • The local password may be cleared depending on disconnect settings

Common errors

API error Cause
client_not_found Extension not connected or already disconnected
extension_timeout Extension did not respond within 30 seconds
extension_error No cookies for that URL, or missing local password
Decryption failed n8n password differs from Connect password

Requirements for reliable operation

  • Chrome must be running with the extension connected
  • The n8n tab or background service worker must keep the WebSocket alive
  • The URL in the request must have cookies in the browser (you must have visited that site)

Next steps