
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@thalesog/nubank-api
Advanced tools
A high level API to connect to Nubank service and download your purchase records.
This project was created because the API changed over time, and the JavaScript projects weren't updated to communicate to the new version. The Python library is updated by the time of this writing, so I used that as reference to build this library.
npm i nubank-api uuid
npm i nubank-api react-native-uuid
const { NubankApi } = require("nubank-api"); // CommonJS syntax
import { NubankApi } from "nubank-api"; // ES Modules syntax
import { v4 as uuidv4 } from "uuid"; // Browser/Node.js
import { v4 as uuidv4 } from "react-native-uuid"; // ReactNative
import { createInterface } from "readline";
import { writeFile } from "fs/promises";
const CPF: string = "your-cpf";
const PASSWORD: string = "your-password";
const AUTH_CODE: string = uuidv4();
const api = new NubankApi();
const rl = createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question(
`Generate a QRcode and read with the app: ${AUTH_CODE}`,
async () => {
try {
await api.auth.authenticateWithQrCode(CPF, PASSWORD, AUTH_CODE);
console.log("You are authenticated!");
console.log(api.authState);
await writeFile("./auth-state.json", JSON.stringify(api.authState)); // Saves the auth data to use later
process.exit(0);
} catch (e) {
console.error(e.stack);
}
}
);
The constructor takes an object containing the authentication details, which are received after the login operation. This avoids extra requests for login to be executed because it can cause your account to be blocked from logging in for up to 72h in this IP.
Key | Type | Description |
---|---|---|
certPath | string | (Optional) path to the SSL certificate. Mandatory in case of authentication via p12 certificate. |
privateUrls | Routes | (Optional) private routes received after authentication. |
publicUrls | Record<string, string> | (Optional) public routes received after authentication. |
All the operations available are methods nested within the object properties.
Property | Description |
---|---|
auth | Authentication operations |
account | Contains methods to access the user account details and the checking account transactions and bills |
card | Contains methods to retrieve the feed of transactions from the credit card |
payment | Contains methods to create payment requests |
http | Wrapper for the API access used by the other modules. Don't use it unless you need to make custom requests not supported by this lib |
FAQs
Yet another Nubank API connector
We found that @thalesog/nubank-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.