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

@venturialstd/kira

v0.0.1

Published

Kira Financial AI Payment Provider Integration Module for Venturial

Readme

@venturialstd/kira

A comprehensive NestJS module for integrating with Kira Financial AI payment provider API.

Features

  • Authentication: Automatic token management with caching
  • Payment Links: Create payment links for various payment methods
  • Real-time Settings: Dynamic configuration via SettingsService

Installation

npm install @venturialstd/kira

Usage

Import the Module

import { Module } from '@nestjs/common';
import { KiraModule } from '@venturialstd/kira';

@Module({
  imports: [KiraModule],
})
export class AppModule {}

Configure Settings

Before using the module, configure Kira API settings through the Settings module:

  • GLOBAL:KIRA:GENERAL:API_KEY - Your Kira API key (required, used in x-api-key header)
  • GLOBAL:KIRA:GENERAL:CLIENT_ID - Client ID for authentication (required)
  • GLOBAL:KIRA:GENERAL:CLIENT_SECRET - Client secret (password) for authentication (required)
  • GLOBAL:KIRA:GENERAL:BASE_URL - Kira API base URL (optional, defaults to https://api.balampay.com/sandbox)

Use the Services

Using Default Credentials (from Settings)

import { Injectable } from '@nestjs/common';
import { KiraPaymentLinkService } from '@venturialstd/kira';

@Injectable()
export class PaymentService {
  constructor(private readonly kiraPaymentLinkService: KiraPaymentLinkService) {}

  async createPaymentLink() {
    // Uses credentials from Settings module
    const paymentLink = await this.kiraPaymentLinkService.createPaymentLink(
      null, // null config uses default settings
      {
        amount: 100.00,
        currency: 'USD',
        country: 'US',
        payout_method: 'bank_transfer',
        description: 'Payment for services',
      },
    );

    return paymentLink;
  }
}

Using Custom Credentials

import { Injectable } from '@nestjs/common';
import { KiraPaymentLinkService, KiraConfig } from '@venturialstd/kira';

@Injectable()
export class PaymentService {
  constructor(private readonly kiraPaymentLinkService: KiraPaymentLinkService) {}

  async createPaymentLinkWithCustomCredentials() {
    // Use custom credentials for this specific call
    const customConfig: KiraConfig = {
      auth: {
        apiKey: 'your-api-key',
        clientId: 'your-client-id',
        clientSecret: 'your-client-secret',
      },
      baseUrl: 'https://api.balampay.com/sandbox', // optional, overrides default
    };

    const paymentLink = await this.kiraPaymentLinkService.createPaymentLink(
      customConfig,
      {
        amount: 100.00,
        currency: 'USD',
        country: 'US',
        payout_method: 'bank_transfer',
        description: 'Payment for services',
        recipient_name: 'John Doe',
        recipient_email: '[email protected]',
        callback_url: 'https://yourapp.com/webhook',
      },
    );

    return paymentLink;
  }
}

API Reference

KiraPaymentLinkService

createPaymentLink(config, request, correlationId?)

Creates a payment link using the Kira API.

Parameters:

  • config: KiraConfig | null - Optional custom credentials. Pass null to use default settings.
  • request: KiraCreatePaymentLinkRequest - Payment link creation request
  • correlationId?: string - Optional correlation ID for tracking

Returns: Promise<KiraCreatePaymentLinkResponse>

Request Fields:

  • first_name: string - Recipient first name (required)
  • middle_name?: string - Recipient middle name (optional)
  • last_name: string - Recipient last name (required)
  • country_code: 'MX' | 'US' | 'SV' | 'GT' - Country code (required)
  • phone: string - Phone number with country code, e.g., "+1234567890" (required)
  • email: string - Recipient email (required)
  • address: string - Recipient address (required)
  • reference: string - Reference UUID (required)
  • amount: number - Payment amount (required)
  • payin: 'card' | 'cash' - Payment method (required)
  • fixed_amount: boolean - Whether amount is fixed (required)
  • max_amount: number - Maximum amount allowed (required)
  • recipient_type: 'business' | 'person' - Recipient type (required)
  • acct_type: 'US' | 'SV' | 'GT' | 'MX' | 'WALLET' - Account type (required)
  • acct_info: KiraAcctInfoUS | KiraAcctInfoSV | KiraAcctInfoGT | KiraAcctInfoMX | KiraAcctInfoWALLET - Account information (required, structure varies by acct_type)
  • client_uuid?: string - Client UUID (automatically added by service)

Response Fields:

  • payment_link: string - URL to the payment link
  • txn_uuid: string - Transaction UUID
  • status: string - Payment status

KiraApiService

authenticate(config?)

Authenticates with Kira API and returns access token. Token is automatically cached until expiration (per credentials).

Parameters:

  • config: KiraConfig | null - Optional custom credentials. Pass null to use default settings.

Returns: Promise<string>

makeApiCall<T>(operationType, endpoint, method, body?, config?, correlationId?)

Makes an authenticated API call to Kira.

Parameters:

  • operationType: KiraApiOperationType - Type of operation
  • endpoint: string - API endpoint
  • method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' - HTTP method
  • body?: Record<string, unknown> - Request body
  • config: KiraConfig | null - Optional custom credentials. Pass null to use default settings.
  • correlationId?: string - Optional correlation ID

Returns: Promise<T>

KiraConfig Interface

interface KiraConfig {
  auth: {
    apiKey: string;
    clientId: string;
    clientSecret: string;
  };
  baseUrl?: string; // Optional, overrides default base URL
}

Authentication

The module automatically handles authentication with Kira API. The access token is cached and refreshed when needed. The authentication flow:

  1. Sends client_id and password (client secret) in the request body
  2. Includes x-api-key header with the API key
  3. Receives JWT access token in response
  4. Caches token until expiration (with 1 minute buffer)

Payment Link Creation

Payment links can be created with various parameters depending on the country and payout method. Required fields:

  • amount: Payment amount
  • currency: Currency code (e.g., 'USD', 'EUR')
  • country: Country code (e.g., 'US', 'GB')
  • payout_method: Payout method type

Optional fields:

  • description: Payment description
  • reference: Reference identifier
  • metadata: Additional metadata

References