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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mybambu/mygalileo-sdk

v1.0.1

Published

TypeScript interface for interacting with MyGalileo APIs

Downloads

14

Readme

MyGalileo SDK

A comprehensive TypeScript SDK for interacting with MyGalileo APIs, providing type-safe access to all Galileo financial services including accounts, transactions, BNPL, loans, and more.

Features

  • Type-Safe Client - Full TypeScript support with automatic type inference
  • Auto Authentication - Automatic token management across all services
  • All Services - Unified interface for accounts, transactions, BNPL, loans, risk, and recipes
  • Error Handling - Typed error responses with detailed messages
  • Tree-Shaking - Individual service imports for optimal bundle size
  • Timeout Control - Configurable request timeouts with abort support

Installation

npm install @mybambu/mygalileo-sdk

Quick Start

import { MyGalileoClient } from '@mybambu/mygalileo-sdk';

// Initialize the client
const client = new MyGalileoClient({
  baseUrl: 'http://localhost:8050',
  timeout: 30000 // optional
});

// Login and authenticate
const { user } = await client.login('[email protected]', 'password123');
console.log(`Logged in as ${user.email}`);

// Use the SDK
const overview = await client.accounts.getAccountOverview('12345678');
console.log(`Balance: $${overview.balance}`);

Authentication

The SDK provides multiple authentication methods with automatic token management.

Method 1: User Login

const { user, access_token } = await client.login(
  '[email protected]',
  'password123'
);
// Token is automatically set for all subsequent requests

Method 2: Access Key Authentication

await client.loginWithAccessKey(
  process.env.MYGALILEO_ACCESS_KEY!,
  process.env.MYGALILEO_ACCESS_SECRET!
);
// Token is automatically set for all subsequent requests

Method 3: Manual Token Management

const client = new MyGalileoClient({
  baseUrl: 'http://localhost:8050',
  accessToken: 'your-jwt-token' // Set token on initialization
});

// Or set it later
client.setAccessToken('your-jwt-token');

// Clear token
client.clearAccessToken();

// Logout
client.logout();

Register New User

const response = await client.auth.register({
  email: '[email protected]',
  username: 'newuser',
  password: 'securePassword123'
});
// Token is returned but not automatically set
client.setAccessToken(response.access_token);

Get User Profile

const profile = await client.auth.getProfile();
console.log(profile.email);

Account APIs

Manage Galileo customer accounts including creation, balance inquiries, and limit management.

Create Account

const account = await client.accounts.createAccount({
  firstName: 'John',
  lastName: 'Doe',
  prodId: '2769',
  email: '[email protected]',
  phoneNumber: '+1234567890',
  loadAmount: 100
});
console.log(`Account created: ${account.accountNo}`);

Get Account Overview

const overview = await client.accounts.getAccountOverview('12345678');
console.log(`Balance: $${overview.balance}`);

Get Account Balance

const balance = await client.accounts.getAccountBalance('12345678');
console.log(`Available: $${balance.availableBalance}`);

Search Accounts

const results = await client.accounts.searchAccounts({
  firstName: 'John',
  status: 'ACTIVE',
  recordCnt: 10
});
console.log(`Found ${results.accounts.length} accounts`);

Update Account Limits

await client.accounts.updateAccountLimits('12345678', {
  dailyPurchaseLimit: 5000,
  dailyWithdrawalLimit: 1000,
  singleTransactionLimit: 2000,
  monthlyLimit: 50000
});

Transaction APIs

Process payments, transfers, and manage transaction history for Galileo accounts.

Create Payment

const payment = await client.transactions.createPayment({
  accountNo: '12345678',
  amount: 50.00,
  description: 'Payment for services',
  externalId: 'order-12345'
});
console.log(`Payment ID: ${payment.transactionId}`);

Create Account Transfer

const transfer = await client.transactions.createTransfer({
  fromAccountNo: '12345678',
  toAccountNo: '87654321',
  amount: 100.00,
  description: 'Transfer between accounts'
});
console.log(`Transfer complete: ${transfer.transactionId}`);

Get Transaction History

const history = await client.transactions.getTransactionHistory('12345678', {
  startDate: '2024-01-01',
  endDate: '2024-12-31',
  recordCount: 50
});
console.log(`Found ${history.transactions.length} transactions`);

BNPL (Buy Now Pay Later) APIs

Manage BNPL plans and purchases with flexible installment options.

Create BNPL Plan

const plan = await client.bnpl.createPlan({
  planName: '4-Month Plan',
  description: 'Pay in 4 monthly installments',
  numberOfInstallments: 4,
  installmentFrequency: 'monthly',
  interestRate: 0,
  minPurchaseAmount: 50,
  maxPurchaseAmount: 5000
});
console.log(`Plan created: ${plan.planId}`);

Create BNPL Purchase

const purchase = await client.bnpl.createPurchase({
  accountNo: '12345678',
  planId: 'plan-001',
  amount: 500,
  merchantName: 'Electronics Store',
  description: 'Laptop purchase'
});
console.log(`Purchase ID: ${purchase.purchaseId}`);

Get BNPL Purchase Details

const details = await client.bnpl.getPurchaseDetails('purchase-123');
console.log(`Remaining: ${details.remainingInstallments} installments`);

Loan APIs

Comprehensive loan management including simulation, creation, and payment tracking.

Simulate Loan

const simulation = await client.loans.simulateLoan({
  accountNo: '12345678',
  loanAmount: 5000,
  numberOfPayments: 12,
  interestRate: 5.99
});
console.log(`Monthly payment: $${simulation.monthlyPayment}`);

Create Loan

const loan = await client.loans.createLoan({
  accountNo: '12345678',
  loanAmount: 5000,
  numberOfPayments: 12,
  interestRate: 5.99,
  firstPaymentDate: '2024-02-01'
});
console.log(`Loan created: ${loan.loanId}`);

Get Loan Status

const status = await client.loans.getLoanStatus('loan-123');
console.log(`Remaining balance: $${status.remainingBalance}`);

Create Loan Payment

const payment = await client.loans.createPayment('loan-123', {
  accountNo: '12345678',
  amount: 450.00,
  paymentType: 'regular'
});
console.log(`Payment processed: ${payment.paymentId}`);

Risk APIs

Fraud detection and identity verification services powered by Galileo's Payment Risk Platform.

Check Card Transaction Fraud

const fraudCheck = await client.risk.checkCardTransactionFraud({
  riskServiceId: 'risk-service-123',
  accountNo: '12345678',
  pan: '4111111111111111',
  amount: 299.99,
  merchantName: 'Online Store',
  merchantLocation: 'New York, NY'
});
console.log(`Risk level: ${fraudCheck.riskLevel}`);

Response:

{
  riskServiceId: "risk-service-123",
  riskScore: 25,
  riskLevel: "low",
  recommendation: "approve",
  fraudIndicators: [],
  velocityChecks: {
    last24Hours: 3,
    last7Days: 15,
    last30Days: 45
  }
}

Instant Identity Verification

const verification = await client.risk.verifyIdentity({
  riskServiceId: 'risk-service-123',
  firstName: 'John',
  lastName: 'Doe',
  dateOfBirth: '1990-01-15',
  ssn4: '1234',
  email: '[email protected]',
  phone: '+12025551234',
  address: '123 Main St',
  city: 'New York',
  state: 'NY',
  zip: '10001'
});
console.log(`Verification score: ${verification.verificationScore}`);

Recipe APIs

Pre-built workflows that combine multiple API calls to accomplish common tasks in a single request.

Customer Onboarding

Combines identity verification and account creation with automatic limit setting based on verification score.

const result = await client.recipes.customerOnboarding({
  firstName: 'Jane',
  lastName: 'Smith',
  email: '[email protected]',
  ssn: '123-45-6789',
  dateOfBirth: '1995-05-15',
  prodId: 'PROD123',
  address: '456 Oak Ave',
  city: 'Seattle',
  state: 'WA',
  zip: '98101'
});
console.log(`Account created: ${result.accountNo}`);

Response:

{
  success: true,
  accountNo: "123456789",
  verificationStatus: "verified",
  verificationScore: 95,
  riskLevel: "low",
  steps: [
    { step: "identity_verification", status: "success" },
    { step: "account_creation", status: "success" },
    { step: "set_limits", status: "success" }
  ]
}

Secure Payment

Performs fraud check before processing payment, automatically declining high-risk transactions.

const result = await client.recipes.securePayment({
  riskServiceId: 'risk-service-123',
  accountNo: '12345678',
  amount: 150.00,
  merchantName: 'Coffee Shop',
  merchantLocation: 'Seattle, WA'
});
console.log(`Payment ${result.approved ? 'approved' : 'declined'}`);

Error Handling

The SDK provides comprehensive error handling with typed errors:

import { MyGalileoClient } from '@mybambu/mygalileo-sdk';

try {
  const client = new MyGalileoClient({
    baseUrl: 'http://localhost:8050'
  });

  await client.loginWithAccessKey('invalid-key', 'invalid-secret');
  const account = await client.accounts.createAccount({
    firstName: 'John',
    lastName: 'Doe',
    prodId: '2769',
    email: '[email protected]'
  });
} catch (error) {
  if (error instanceof Error) {
    console.error('Error:', error.message);

    // Handle specific error types
    if (error.message.includes('401')) {
      console.error('Authentication failed');
    } else if (error.message.includes('400')) {
      console.error('Validation error');
    }
  }
}

Common Error Codes

| Code | Description | |------|-------------| | 400 | Bad Request - validation error or missing required fields | | 401 | Unauthorized - invalid or expired access token | | 404 | Not Found - resource doesn't exist | | 409 | Conflict - duplicate resource (e.g., account already exists) | | 500 | Internal Server Error - unexpected server error |

Best Practices

  1. Secure Token Storage: Store access tokens securely using encrypted storage or environment variables. Never commit tokens to version control.

  2. Token Refresh: Implement token refresh logic before expiration (tokens expire after 24 hours).

  3. Error Handling: Always handle API errors gracefully and provide meaningful feedback to users.

  4. HTTPS Only: Always use HTTPS in production environments.

  5. Environment Variables: Store access keys and secrets in environment variables:

    await client.loginWithAccessKey(
      process.env.MYGALILEO_ACCESS_KEY!,
      process.env.MYGALILEO_ACCESS_SECRET!
    );
  6. Type Safety: Leverage TypeScript types for compile-time error detection.

  7. Individual Service Imports: For smaller bundle sizes, import only what you need:

    import { AccountService } from '@mybambu/mygalileo-sdk';
    
    const accountService = new AccountService({
      baseUrl: 'http://localhost:8050',
      accessToken: 'your-token'
    });
  8. Timeout Configuration: Configure appropriate timeouts for your use case:

    const client = new MyGalileoClient({
      baseUrl: 'http://localhost:8050',
      timeout: 60000 // 60 seconds
    });

Support

For issues or questions, please contact the MyBambu development team.