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

@lume-ai/typescript-sdk

v5.3.2

Published

Lume SDK for Typescript to automate data mappings with AI. Learn more at docs.lume.ai

Readme

Lume AI TypeScript SDK

The official TypeScript SDK for Lume AI's data transformation platform.

Features

  • 🚀 Create and manage data transformation flows
  • 🔄 Transform data using AI-powered mapping
  • ✨ Real-time validation and error handling
  • 📊 Rich schema support

Status

The Lume Typescript SDK is currently in beta. Please reach out to support if you have any questions, encounter any bugs, or have any feature requests.

Installation

npm install @lume-ai/typescript-sdk
yarn add @lume-ai/typescript-sdk
pnpm add @lume-ai/typescript-sdk

Quickstart

Initialize the SDK

import { Lume } from "@lume-ai/typescript-sdk";

const lume = new Lume("your-api-key");

Create a Flow and Run

// Define your target schema
const targetSchema = {
  type: "object",
  properties: {
    full_name: { type: "string", description: "Full name of the person" },
    age: { type: "integer", description: "Age of the person" },
  },
  required: ["full_name", "age"],
};
const lume = new Lume(apiKey);

// Create and run a new flow. Return only when the flow is complete.
const flow = await lume.flowService.createAndRunFlow(
  {
    name: "my_flow",
    description: "Process customer data",
    target_schema: schema,
    tags: ["customers"],
  },
  {
    source_data: myData,
  },
  true
);

// Process more data with existing flow
const flowId = "existing-flow-id";
const existingFlow = await lume.flowService.getFlow(flowId);
const results = await existingFlow.process(newData);

// use mapped data results page

Example of fetching results with pagination

Note: While the SDK provides paginated access to results, we recommend processing data page by page for large datasets. The following example shows how you could fetch all results:

// Helper function - not part of the SDK
async function getAllResults(flow) {
  const pageSize = 50;
  let currentPage = 1;
  let allResults = [];

  while (true) {
    const paginatedResults = await flow.getLatestRunResults(
      currentPage,
      pageSize
    );

    if (!paginatedResults?.items || paginatedResults.items.length === 0) {
      break; // No more results to fetch
    }

    allResults = [...allResults, ...paginatedResults.items];

    // If we have total pages info and we've reached the last page, stop
    if (paginatedResults.pages && currentPage >= paginatedResults.pages) {
      break;
    }

    currentPage++;
  }

  return allResults;
}

// Usage
const flow = await lume.flowService.getFlow(flowId);
const allResults = await getAllResults(flow);
console.log(`Retrieved ${allResults.length} total items`);

Monitor Run Status

The Run class provides methods to track transformation progress and access results:

// Get latest run status
await run.get();
console.log(run.status); // 'SUCCEEDED', 'FAILED', etc.

// Access run metadata
console.log(run.metadata);

// Get transformation output with pagination
const output = await run.getSchemaTransformerOutput(1, 50);
if (output) {
  console.log("Transformed items:", output.mapped_data.items);
  console.log("Total items:", output.mapped_data.total);
  console.log("Validation errors:", output.errors);
}

Monitoring Flow Status

You can monitor the status of flows and runs:

// Create a flow and wait for completion
const flow = await lume.flowService.createFlow({
  name: "my_flow",
  description: "Process customer data",
  target_schema: schema,
  tags: ["production"],
});

// Monitor run status
const run = await flow.createRun({ source_data: data });
while (run.status === "RUNNING" || run.status === "PENDING") {
  await new Promise((resolve) => setTimeout(resolve, 1000));
  await run.get();
}

if (run.status === "SUCCEEDED") {
  const results = await run.getSchemaTransformerOutput();
  console.log("Transformation complete:", results);
} else {
  console.log("Run failed:", run.status);
}

Validation Handling

You can track which fields were flagged for validation errors:

try {
  const flow = await lume.flowService.createFlow({
    // ... flow configuration ...
  });

  const run = await flow.createRun({ source_data: data });
  const output = await run.getSchemaTransformerOutput();

  if (output?.errors) {
    // Handle different types of validation errors
    if ("global_errors" in output.errors) {
      // Handle global validation errors
      const globalErrors = output.errors.global_errors;
      console.log("Global validation errors:", globalErrors);
    }

    if ("record_errors" in output.errors) {
      // Handle record-specific errors
      const recordErrors = output.errors.record_errors;
      for (const [recordIndex, errors] of Object.entries(recordErrors)) {
        console.log(`Errors in record ${recordIndex}:`, errors);
      }
    }

    // Handle field-specific validation errors
    for (const [field, fieldErrors] of Object.entries(output.errors)) {
      if (field !== "global_errors" && field !== "record_errors") {
        console.log(`Validation errors for ${field}:`, fieldErrors);
      }
    }
  }

  // Handle records that couldn't be processed
  if (output?.no_data_idxs?.length) {
    console.log("Records that could not be processed:", output.no_data_idxs);
  }
} catch (error) {
  if ((error as HTTPExceptionError).code === 401) {
    console.log("Authentication failed - check your API key");
  } else if ((error as HTTPExceptionError).code === 429) {
    console.log("Rate limit exceeded - please try again later");
  } else if ((error as HTTPExceptionError).code === 400) {
    console.log("Invalid request:", (error as HTTPExceptionError).message);
  } else {
    console.log("Unexpected error:", error);
  }
}

Documentation

See the full documentation.

Issues / Questions

Please reach out to support if you encounter any bugs, have any questions, or have any feature requests.