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

@allma/core-sdk

v1.3.0

Published

Core SDK with shared utilities (logging, auth, S3 utils) for building on the Allma serverless AI orchestration platform.

Readme

@allma/core-sdk

npm version License

This package provides a collection of shared utilities for building on the Allma platform. It is primarily designed to be used within AWS Lambda functions, such as custom step handlers (CUSTOM_LAMBDA_INVOKE) or Admin API handlers.

What is Allma?

Allma is a serverless, event-driven platform designed to build, execute, and manage complex, AI-powered automated workflows, known as Flows. It acts as a "digital factory" for orchestrating sophisticated business processes, combining data integration, conditional logic, and advanced AI capabilities in a robust, scalable, and observable environment built on AWS.

Key Features

  • Structured JSON Logger: A simple, level-based logger that outputs structured JSON for easy searching and analysis in Amazon CloudWatch Logs.
  • S3 Payload Offloading: Utilities (offloadIfLarge, hydrateInputFromS3Pointers) to automatically handle large data payloads by storing them in S3, avoiding AWS service limits.
  • API Response Builders: Helpers for creating standardized, consistent API Gateway responses.
  • Auth Middleware: A higher-order function (withAdminAuth) to easily secure Admin API Lambda handlers with Cognito JWT authentication.
  • JSON Repair Utility: A robust function (extractAndParseJson) to parse JSON from noisy LLM outputs.

Installation

npm install @allma/core-sdk

Core Usage

Example: Using the structured logger in a custom Lambda handler.

import { log_info, log_error } from '@allma/core-sdk';
import { Handler } from 'aws-lambda';

export const handler: Handler = async (event, context) => {
  const correlationId = context.awsRequestId; // Use a request ID for tracing

  log_info('Handler invoked', { input: event }, correlationId);

  try {
    // ... Your business logic here ...
    const result = { status: 'success' };
    log_info('Processing completed successfully', { result }, correlationId);
    return result;
  } catch (error: any) {
    log_error('An unexpected error occurred during processing', { 
      errorName: error.name,
      errorMessage: error.message,
      stack: error.stack 
    }, correlationId);

    // Re-throw the error or handle it as needed
    throw new Error('Processing failed');
  }
};

Redacting log output

Register one redactor and every log_* call passes through it. It runs on the details object (it must return a plain object) and on the message string (it must return a string). If it throws or returns the wrong type, the line is written with message and details set to '[REDACTION_FAILED]'. The raw values are never written.

import { createKeyPatternRedactor, setLogRedactor } from '@allma/core-sdk';

setLogRedactor(createKeyPatternRedactor({
  keys: ['email', 'phone'],           // case-insensitive key names; their values are replaced
  patterns: ['[^@\\s]+@[^@\\s]+'],    // regexes (flags "gi") replaced inside every string and the message
  replacement: '[PII]',               // optional, defaults to '[REDACTED]'
}));

// Or pass your own function: setLogRedactor((value) => myRedact(value));
// setLogRedactor(undefined) removes it.

The redactor is process-wide and is shared by every copy of @allma/core-sdk in the bundle. If the LOG_REDACTION_CONFIG environment variable holds a JSON { keys, patterns, replacement? } object, the logger registers createKeyPatternRedactor with it when it loads, unless a redactor is already registered. If that config is invalid, every line is masked and one warning is logged.

Contributing

This package is part of the allma-core monorepo. We welcome contributions! Please see our main repository and contribution guide for more details.

License

This project is licensed under the Apache-2.0 License.