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

@nds-stack/ibank-bca-sdk

v1.0.0

Published

Unofficial iBank BCA SDK - Cek saldo & mutasi rekening BCA via HTTP

Readme

@nds-stack/ibank-bca-sdk

Unofficial iBank BCA SDK - Cek saldo & mutasi rekening BCA via HTTP murni

npm version license runtime

Fitur

  • Login ke iBank BCA (m.klikbca.com)
  • Cek Saldo rekening
  • Cek Mutasi rekening (7 hari terakhir)
  • Deteksi QRIS/EDC - Identifikasi transaksi dari merchant
  • Session persistence - Simpan & restore cookies
  • Zero dependency - Hanya menggunakan native fetch & crypto
  • Runtime agnostic - Bun, Node.js 18+, Deno

Instalasi

# Bun
bun add @nds-stack/ibank-bca-sdk

# npm
npm install @nds-stack/ibank-bca-sdk

# yarn
yarn add @nds-stack/ibank-bca-sdk

# pnpm
pnpm add @nds-stack/ibank-bca-sdk

Penggunaan Dasar

import { IBank } from '@nds-stack/ibank-bca-sdk';

const ibank = new IBank();

// Login
const login = await ibank.login('USERID1234', '123456');

if (login.success) {
  // Cek saldo
  const balance = await ibank.getBalance();
  console.log(`Saldo: Rp ${balance.account.balanceFormatted}`);
  
  // Cek mutasi 7 hari terakhir
  const end = new Date();
  const start = new Date();
  start.setDate(start.getDate() - 7);
  
  const mutations = await ibank.getMutations(start, end);
  console.log(`Transaksi: ${mutations.transactions.length} items`);
  
  // Logout
  await ibank.logout();
}

Deteksi QRIS/EDC

import { IBank, OutletMapper, setOutletMapper } from '@nds-stack/ibank-bca-sdk';

// Setup outlet mapping
const mapper = new OutletMapper();
mapper.add('QRIS', 'My Shop', '002XXXXXX');
mapper.add('QRIS', 'My Cafe', '002XXXXXX');
mapper.add('EDC', 'EDC Machine', '002XXXXXX');
setOutletMapper(mapper);

const ibank = new IBank();
await ibank.login('USER', 'PIN');
const mutations = await ibank.getMutations(start, end);

// Filter transaksi QRIS
const qrisTransactions = mutations.transactions.filter(
  t => t.sourceType === 'QRIS'
);

qrisTransactions.forEach(t => {
  console.log(`${t.outlet}: Rp ${t.amount} (Gross: ${t.gross}, Fee: ${t.fee})`);
});

Session Persistence

const ibank = new IBank();

// Coba restore session dari file/DB
const savedSession = JSON.parse(localStorage.getItem('bca_session'));
if (savedSession) {
  ibank.restoreSession(savedSession);
  
  // Test session valid
  try {
    const balance = await ibank.getBalance();
    console.log('Session restored!', balance);
  } catch {
    // Session expired, login baru
    await ibank.login('USER', 'PIN');
  }
}

// Simpan session setelah selesai
const session = ibank.saveSession();
localStorage.setItem('bca_session', JSON.stringify(session));

// JANGAN logout jika ingin session tetap valid!
await ibank.closeSession(); // Tutup tanpa logout

API Reference

new IBank(options?)

| Parameter | Type | Description | |-----------|------|-------------| | options.outlets | Array | Daftar outlet untuk deteksi QRIS/EDC |

ibank.login(userId, pin)

| Parameter | Type | Description | |-----------|------|-------------| | userId | string | User ID BCA (8 huruf + 4 angka) | | pin | string | 6 digit PIN |

Returns: Promise<{ success: boolean, error?: string }>

ibank.getBalance()

Returns: Promise<{ success: boolean, account?: {...}, error?: string }>

ibank.getMutations(startDate, endDate)

| Parameter | Type | Description | |-----------|------|-------------| | startDate | Date | Tanggal mulai (max 31 hari ke belakang) | | endDate | Date | Tanggal akhir (max 7 hari dari start) |

Returns: Promise<MutationResult>

Transaction Object

{
  date: string;           // "18/04/2026" atau "PEND"
  description: string;    // Deskripsi transaksi
  type: 'CR' | 'DB';     // CR = masuk, DB = keluar
  amount: number;         // Jumlah
  sourceType: 'QRIS' | 'EDC' | 'TRANSFER';  // Sumber
  outlet: string | null;  // Nama outlet (jika QRIS/EDC)
  mid: string | null;     // Merchant ID
  gross?: number;         // Amount sebelum fee
  fee?: number;           // Biaya admin
  feeRate?: number;       // Persentase fee
}

Session Methods

| Method | Description | |--------|-------------| | ibank.saveSession() | Simpan session ke object | | ibank.restoreSession(session) | Restore session dari object | | ibank.closeSession() | Tutup tanpa logout (session tetap valid) | | ibank.logout() | Logout + hapus session |

OutletMapper

import { OutletMapper, setOutletMapper } from '@nds-stack/ibank-bca-sdk';

const mapper = new OutletMapper();

// Tambah satu outlet
mapper.add('QRIS', 'My Shop', '002XXXXXX');

// Tambah banyak outlet sekaligus
mapper.addAll([
  { type: 'QRIS', outlet: 'My Shop', mid: '002XXXXXX' },
  { type: 'EDC', outlet: 'My EDC', mid: '002XXXXXX' }
]);

// Set sebagai mapper global
setOutletMapper(mapper);

Batasan

| Batasan | Keterangan | |---------|------------| | Akun | 1 akun per instance | | Session | Expired setelah 5 menit idle | | Mutasi | Max 7 hari per request | | Historis | Max 31 hari ke belakang | | Metode | Hanya POST (GET tidak didukung) |

Catatan Penting

⚠️ Package ini adalah unofficial SDK. Gunakan dengan bijak dan patuhi Terms of Service BCA.

⚠️ Jangan melakukan request terlalu sering untuk menghindari pemblokiran akun.

Testing

# Copy credentials example
cp .env.example .env

# Edit .env dengan kredensial Anda
# BCA_USERID=YOUR_USER_ID
# BCA_PIN=YOUR_PIN

# Jalankan test
bun run test/basic.test.js

License

MIT © NDS Stack

Related Packages

| Package | Description | |---------|-------------| | @nds-stack/qris-utils | QRIS Parser & Generator | | @nds-stack/bca-merchant-sdk | BCA Merchant SDK |