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

@usemona/mona-consent-sdk

v1.1.17

Published

OyaMoney SDK for embedding consent flows

Readme

OyaMoney SDK

A JavaScript SDK for embedding OyaMoney consent flows into your web application.

Installation

npm install @oya-money/sdk

Usage

Basic Usage

import OyaMoneySDK from '@oya-money/sdk';

const sdk = new OyaMoneySDK({
  accessToken: 'your-access-token',
  apiUrl: 'https://api.oyamoney.com', // optional, defaults to localhost:3002
  clientId: 'your-client-id' // required for attest SDK branding
});

// Load a consent flow
await sdk.loadConsent('consent-id-here', {
  theme: 'light', // 'light' or 'dark'
  position: 'center', // 'center' or 'bottom'
  width: '400px',
  height: '600px',
  backgroundColor: '#FF5733' // Optional: hex color for background
});

Browser Usage

<script src="https://unpkg.com/@oya-money/sdk/dist/sdk.js"></script>
<script>
  const sdk = new OyaMoneySDK({
    accessToken: 'your-access-token'
  });
  
  sdk.loadConsent('consent-id-here');
</script>

Features

Background Color Customization

You can customize the background color of the consent flow by passing a backgroundColor option:

// With hex color (with or without #)
await sdk.loadConsent('consent-id-here', {
  backgroundColor: '#FF5733'  // Orange background
});

await sdk.loadConsent('consent-id-here', {
  backgroundColor: '00FF00'   // Green background (without #)
});

The SDK validates the hex color format and will fall back to the default gray background if an invalid color is provided.

Attest SDK Integration

The OyaMoney SDK integrates with the Mona Attest SDK for user authentication and biometric verification. When you provide a clientId in the SDK configuration, it will be passed through to the consent page, which will then use it to fetch merchant-specific branding for the attest flow.

const sdk = new OyaMoneySDK({
  accessToken: 'your-access-token',
  clientId: 'your-client-id' // This will be used for attest branding
});

The clientId should correspond to an API user that is owned by a merchant user with configured branding colors and information.

API Reference

OyaMoneySDK

Constructor

new OyaMoneySDK(config: OyaMoneyConfig)

config:

  • accessToken (string, required): Your OyaMoney access token
  • apiUrl (string, optional): API base URL, defaults to http://localhost:3002
  • clientId (string, required): Client ID for attest SDK branding integration

Methods

loadConsent(consentId, options?)

Loads a consent flow in a modal.

Parameters:

  • consentId (string): The ID of the consent to load
  • options (object, optional): Modal configuration
    • theme ('light' | 'dark'): Modal theme, defaults to 'light'
    • position ('center' | 'bottom'): Modal position, defaults to 'center'
    • width (string): Modal width, defaults to '400px'
    • height (string): Modal height, defaults to '600px'
    • backgroundColor (string, optional): Hex color for background (e.g., '#FF5733' or 'FF5733')

Development

# Install dependencies
npm install

# Build for production
npm run build

# Development mode with watch
npm run dev

# Clean build artifacts
npm run clean

License

MIT