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

@yuno-payments/sdk-event-log

v1.12.0

Published

Register application logs and events

Readme

@yuno-payments/sdk-event-log

SDK library for registering application logs, events, and metrics from Yuno's frontend SDKs.

Installation

npm install @yuno-payments/sdk-event-log

Peer dependency: axios ^1.13.6

Usage

import { EventLog } from '@yuno-payments/sdk-event-log'

const eventLog = new EventLog({
  organizationName: 'my-org',
  publicApiKey: 'your-public-api-key',
  enableEvents: true,
  enableLogs: true,
  enableCron: true,
  batchTime: 5000,
})

Events

eventLog.event({
  source: 'checkout',
  event: 'payment_started',
  description: 'User started payment flow',
  original_created_at: new Date().toISOString(),
  sdk_version: '1.0.0',
  application_name: 'checkout-sdk',
  application_session: 'session-123',
  environment: 'production',
})

Logs

eventLog.logger.info({
  original_created_at: new Date().toISOString(),
  sdk_version: '1.0.0',
  application_name: 'checkout-sdk',
  application_session: 'session-123',
  environment: 'production',
  step_name: 'payment',
  step_function: 'submitPayment',
  step_location: 'checkout.ts',
})

eventLog.logger.error({ /* same shape */ })
eventLog.logger.debug({ /* same shape */ })

Metrics

eventLog.setMetric({
  environment: 'production',
  dynamic_sdk: false,
  original_created_at: new Date().toISOString(),
  original_created_at_ms: Date.now(),
  flow_trace_id: 'trace-abc',
  sdk_version: '1.0.0',
  type: 'performance',
  metadata: {
    public_api_key: 'your-key',
  },
  payload: { loadTime: 1200 },
})

Manual batch send

await eventLog.sendBatch()        // Send queued logs/events
await eventLog.sendMetricBatch()  // Send queued metrics

Runtime configuration

eventLog.setConfig({
  enableEvents: true,
  enableLogs: false,
  enableCron: true,
  batchTime: 10000,
  maxBatchQueued: 50,
})

Constructor options

| Option | Type | Default | Description | |---|---|---|---| | organizationName | string | required | Organization identifier | | publicApiKey | string | required | Public API key for authentication | | enableEvents | boolean | true | Enable event tracking | | enableLogs | boolean | true | Enable log tracking | | enableCron | boolean | undefined | Enable automatic batch sending | | batchTime | number | undefined | Interval (ms) for cron batch sends | | maxBatchQueued | number | 30 | Max items before auto-flush | | platform | string | 'Web' | Platform identifier | | language | string | undefined | Accept-Language header value | | country | string | undefined | Country code | | xVersion | string | undefined | SDK version header | | workflow | string | 'SDK_CHECKOUT' | Workflow identifier | | cookieName | string | 'yuno' | Cookie name for device ID | | deviceId | string | auto-generated | Override device ID | | clientAppDomain | string | undefined | Override client app domain | | enableMetrics | boolean | false | Enable metrics collection | | debug | boolean | false | Enable console debug output |

Storage

Events are queued locally before being sent in batches:

  • Browser: Uses localStorage (key: YUNO_EVENT_LOGS_{orgName})
  • Non-browser: Uses in-memory storage

Both storages cap at 200 items to prevent unbounded growth.

Development

npm test          # Run tests
npm run test:dev  # Run tests in watch mode
npm run build     # Test + clean + build (CJS + ESM)

Local testing with npm link

# In this repo
npm run build && npm link

# In the consuming project
npm link @yuno-payments/sdk-event-log