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

promptmgr-sdk

v1.2.0

Published

[Promptmgr](https://www.promptmgr.com/) is a prompt engineering & management tool for teams to collaborate on creating, testing, and deploying AI prompts with confidence. It allows business team members to create better AI prompts while developers can foc

Downloads

5

Readme

PROMPTMGR SDK

Promptmgr is a prompt engineering & management tool for teams to collaborate on creating, testing, and deploying AI prompts with confidence. It allows business team members to create better AI prompts while developers can focus on handling the technical setup.

Installation

npm install promptmgr-sdk

Configuration

First, initialize the SDK with your credentials:

import PromptManager from 'promptmgr-sdk';

const promptManager = new PromptManager({
  baseUrl: 'YOUR_BASE_URL', // Required only when self-hosting
  secretKey: 'YOUR_SECRET_KEY',
  environment: 'YOUR_ENVIRONMENT',
  projectId: 'YOUR_PROJECT_ID'
});

You can also use environment variables:

PROMPTMGR_URL=YOUR_BASE_URL
PROMPTMGR_SECRET_KEY=YOUR_SECRET_KEY
PROMPTMGR_ENVIRONMENT=YOUR_ENVIRONMENT
PROMPTMGR_PROJECT_ID=YOUR_PROJECT_ID

Basic Usage

Running a Single Prompt

Use the run method to execute a single prompt:

const response = await promptManager.run({
  promptId: 'your-prompt-id',
  action: 'your-action',
  variables: [
    {
      field: 'content_type',
      value: 'tweet'
    },
    {
      field: 'topic',
      value: 'AI Technology'
    }
  ]
});

Getting Prompt Content

If you are only using Promptmgr for prompt creation and testing, you can retrieve the prompt using getPrompt:

const prompt = await promptManager.getPrompt({
  promptId: 'your-prompt-id',
  variables: [
    {
      field: 'content_type',
      value: 'tweet'
    },
    {
      field: 'topic',
      value: 'AI'
    }
  ]
});

Chaining Prompts

The SDK supports chaining multiple prompts where the output of one prompt can be used as input for the next:

const results = await promptManager.chain()
  .run({
    id: 'step1',
    promptId: 'first-prompt-id',
    action: 'generate',
    variables: [
      {
        field: 'content_type',
        value: 'tweet'
      },
      {
        field: 'topic',
        value: 'AI Technology'
      }
    ]
  })
  .run({
    id: 'step2',
    promptId: 'second-prompt-id',
    action: 'generate',
    variables: ({ prevResults }) => [
      {
        field: 'content_type',
        value: 'linkedin post'
      },
      {
        field: 'topic',
        value: prevResults.step1.response
      }
    ]
  })
  .execute();

In chain operations:

  • Each step must have a unique id
  • You can access previous results using the prevResults parameter in variable functions
  • Use execute() to run the chain

API Reference

PromptManager.run(config)

  • config.promptId (required): The ID of the prompt to run
  • config.action: The action to perform (for monitoring)
  • config.variables: Array of variable objects with field and value

PromptManager.getPrompt(config)

  • config.promptId (required): The ID of the prompt to retrieve
  • config.variables: Array of variable objects with field and value

PromptManager.chain()

Creates a chain builder for running multiple prompts in sequence. Each run() call in the chain requires:

  • id: Unique identifier for the step
  • promptId: The ID of the prompt to run
  • action: The action identifier for monitoring
  • variables: Array of variables or function returning variables

Error Handling

The SDK throws errors for:

  • Missing required configuration
  • Invalid API responses
  • Chain execution failures
  • Duplicate step IDs in chains

Wrap your SDK calls in try-catch blocks for proper error handling:

try {
  const response = await promptManager.run({
    promptId: 'your-prompt-id',
    action: 'generate',
    variables: [...]
  });
} catch (error) {
  console.error('Error running prompt:', error);
}

Common errors include:

  • Missing or invalid credentials
  • Network connectivity issues
  • Invalid prompt IDs
  • Missing required parameters
  • Chain execution failures

Debugging

When running in development mode (NODE_ENV=development), the SDK provides detailed logging of:

  • API requests
  • Configuration
  • Errors

Support

For support: