npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nurtrade

v0.1.0

Published

Inoffizielles TypeScript-SDK + CLI für die Trade-Republic-API (read & trade)

Readme

nurtrade

Inoffizielles TypeScript-SDK + CLI für Trade Republic – Portfolio, Kurse, Transaktionen, Dokumente und (mit Sicherheitsnetz) Trading.

⚠️ Disclaimer Dies ist ein inoffizielles Projekt und steht in keiner Verbindung zur Trade Republic Bank GmbH. Es nutzt die private, reverse-engineerte App-API. Die Nutzung kann gegen die AGB von Trade Republic verstoßen und auf eigenes Risiko erfolgen. Trade Republic erlaubt nur ein aktives Gerät – ein Login über dieses SDK kann dich aus der Handy-App ausloggen. Trading bewegt echtes Geld: Es gibt keine Garantie für Korrektheit. Verwende es bewusst.

Installation

npm install nurtrade
# Optional, für die automatische WAF-Lösung (siehe unten):
npm install playwright && npx playwright install chromium

Anmeldung & die AWS-WAF-Hürde

Trade Republic schützt die Login-Endpoints mit AWS-WAF. Dafür wird ein aws-waf-token benötigt, das über eine JS-Challenge im Browser entsteht. Es gibt zwei Wege:

  1. Automatisch (empfohlen): das optionale Paket playwright installieren – PlaywrightWafSolver löst die Challenge in einem Headless-Chromium.
  2. Manuell: Token aus den Browser-DevTools (Cookie aws-waf-token auf app.traderepublic.com) kopieren und via ManualWafSolver übergeben.

CLI

nurtrade login                 # Telefonnummer + PIN + 2FA-Code
nurtrade login --waf-token <t> # mit manuellem WAF-Token

nurtrade portfolio             # Positionen
nurtrade cash                  # Kontostand / verfügbares Cash
nurtrade transactions          # Transaktionshistorie (erste Seite)
nurtrade ticker US0378331005   # Live-Kurs streamen (Strg+C beendet)
nurtrade search apple          # Instrumente suchen
nurtrade export transactions --out tx.csv
nurtrade documents --out ./docs   # alle PDFs herunterladen

# Trading – standardmäßig DRY-RUN (zeigt nur, was gesendet würde):
nurtrade order buy US0378331005 --size 1 --limit 150
nurtrade order buy US0378331005 --size 1 --limit 150 --yes   # WIRKLICH senden

Die Sitzung wird unter ~/.nurtrade/session.json gespeichert (Modus 600).

Library

import { TradeRepublic, PlaywrightWafSolver } from "nurtrade";

const tr = new TradeRepublic({ waf: new PlaywrightWafSolver() });

// Einmalig anmelden (danach reicht restore()):
await tr.login({ phoneNumber: "+4915...", pin: "1234" }, async (challenge) => {
  // 2FA-Code besorgen (z. B. aus der TR-App-Push oder SMS)
  return prompt(`Code (${challenge.type})`)!;
});

await tr.connect();

// Lesen
const portfolio = await tr.portfolio.portfolio();
const cash = await tr.portfolio.cash();
const detail = await tr.market.stockDetails("US0378331005");

// Live-Kurs streamen
for await (const quote of tr.market.ticker("US0378331005")) {
  console.log(quote);
}

// Trading – Dry-Run by default:
const dry = await tr.trading.createOrder({
  isin: "US0378331005", side: "BUY", mode: "limit", size: 1, limit: 150,
});
console.log(dry.dryRun, dry.payload); // true, { ...simpleCreateOrder }

// Erst mit confirm wird gesendet:
const sent = await tr.trading.createOrder(
  { isin: "US0378331005", side: "BUY", mode: "limit", size: 1, limit: 150 },
  { confirm: true },
);

tr.close();

Wiederverbinden

const tr = new TradeRepublic();
if (await tr.restore()) {
  await tr.connect();
} else {
  // erneut einloggen …
}

Architektur

transport/  delta · frame · protocol (Sans-IO) · websocket · http · waf
auth/       auth (Web-Login + 2FA) · session-store (File/Memory)
core/       client (Facade) · subscriber
domain/     portfolio · market · timeline · watchlist · trading · order-builder
export/     csv · documents (PDF-Massen-Download)
cli/        commander-Commands

Das WebSocket-Protokoll ist in einer I/O-freien Protocol-Engine gekapselt (Handshake, sub/unsub, Frame-Codes A/D/C/E, Tab-Delta-Decoding), sodass es ohne echtes Netz vollständig getestet ist.

Entwicklung

npm test        # Vitest (Unit + Integration, kein Live-Account nötig)
npm run build   # tsup → dist/ (ESM + .d.ts)
npm run typecheck

Lizenz

MIT