Skip to content

nulldreams/node-bank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Size Limit example

A Nubank API in NodeJS

Size Limit example


Important

Nubank has change the auth flow, now you need to validate a QRCode to have access in all API routes. I'm working on a new version that has QRCode validation, so this actually version doesn't work anymore.

Install

npm install node-bank

Methods

  • nodebank.start: start the library
  • nodebank.login(cpf, password): login into nubank API

Functions

  • Events
    • nodebank.events.findAll: return an array of your payments, transactions, etc...
    • nodebank.events.findByDate: return an event array by date
    • nodebank.events.findByName: return an event array by category name
    • nodebank.events.filter: return an array of your query
  • Bills
    • nodebank.bills.all: return and array of your invoices
    • nodebank.bills.findByDate: return an bill by due date
    • nodebank.bills.filter: return an array of your query
    • nodebank.bills.info: return all info of a bill
    • nodebank.bills.barcode: return an object with number of "boleto"s bill
    • nodebank.bills.emailBill: comming soon

Examples

First of all

nodebank.start

await nubank.start()

nodebank.login(cpf, password)

await nubank.login({ cpf: '__cpf', pass: '__password' }) 

Events

nodebank.events.findAll

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
let arr = await nubank.events.findAll()

nodebank.events.findByName

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
let arr = await nubank.events.findByName({ name: 'Github.com', events: arr.events })

nodebank.events.findByDate

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
let arr = await nubank.events.findByDate({ date: '2018-10-10', events: arr.events })

nodebank.events.filter

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
    
let subcategories = nubank.events.categories.subcategories
let arr = await nubank.events.filter({ query: [ 'details.subcategory', subcategories.card_not_present ], events: arr.events })

Bills

nodebank.bills.all

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
    
let bills = await nubank.bills.all()

nodebank.bills.findByDate

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
    
let arrBills = await nubank.bills.all()
    
let [bill] = await nubank.bills.findByDate({ date: '2018-11-11', bills: arrBills.bills })

nodebank.bills.info

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 
    
let arrBills = await nubank.bills.all()
    
let [bill] = await nubank.bills.findByDate({ date: '2018-11-11', bills: arrBills.bills })

let info = await nubank.bills.info({ bill })

nodebank.bills.barcode

await nubank.start()
await nubank.login({ cpf: '__cpf', pass: '__password' }) 

let arrBills = await nubank.bills.all()

let [bill] = await nubank.bills.findByDate({ date: '2018-11-11', bills: arrBills.bills })

let info = await nubank.bills.info({ bill })

let barcode = await nubank.bills.barcode({ info: info.bill })

Credits

This software uses some open source packages.

Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub


GitHub @nulldreams Β Β·Β 

About

A Nubank API in NodeJS πŸ’³πŸ’œ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published