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

keap-client

v0.2.1

Published

A client to work with Infusionsoft/Keap API.

Downloads

22

Readme

keap-client

npm version License: MIT TypeScript

Note: This library is currently under active development.

A modern TypeScript client for the Keap/Infusionsoft REST API. This library provides a simple, type-safe interface to interact with Keap's API, making it easier to integrate Keap functionality into your applications.

Features

  • 🚀 TypeScript First - Full type safety and IntelliSense support
  • 🔄 Auto-retry - Configurable retry logic for failed requests
  • ⏱️ Timeout Control - Customizable request timeouts
  • 📦 Modular Design - Clean, organized API surface
  • 🔒 Secure - Built-in API key authentication
  • 📖 Well Documented - Comprehensive JSDoc comments

Installation

npm install keap-client
yarn add keap-client
pnpm add keap-client

Quick Start

import { KeapClient } from 'keap-client';

// Initialize the client
const keap = new KeapClient({
  apiKey: 'your-api-key-here', // Required: Get this from your Keap app
  requestTimeout: 5000,        // Optional: Request timeout in milliseconds (default: 10000)
  retries: 3                   // Optional: Number of retry attempts (default: 0)
});

// Fetch a contact
const contact = await keap.Contact.getContact(123);
console.log(contact.email);

// Update contact information
await contact.update({ 
  email_opted_in: true,
  given_name: 'John',
  family_name: 'Doe' 
});

// Apply tags to contact
await contact.applyTags(['customer', 'newsletter-subscriber']);

API Reference

Client Configuration

interface KeapClientOptions {
  apiKey: string;          // Your Keap API key (required)
  requestTimeout?: number; // Request timeout in milliseconds (optional)
  retries?: number;        // Number of retry attempts (optional)
}

Available Models

✅ Implemented

  • Account Info - Retrieve account information
  • Contact - Manage contacts and their data
  • E-Commerce - Handle e-commerce related operations
  • Email - Manage email communications
  • File - File upload and management
  • Opportunity - Sales opportunity tracking
  • Product - Product catalog management
  • Tags - Contact tagging system
  • Users - User management

🚧 Coming Soon

  • Affiliate
  • Appointment
  • Campaign
  • Company
  • Email Address
  • Locale
  • Merchant
  • Note
  • REST Hooks
  • Setting
  • Task
  • User Info

Usage Examples

Working with Contacts

// Get a specific contact
const contact = await keap.Contact.getContact(123);

// Create a new contact
const newContact = await keap.Contact.createContact({
  given_name: 'Jane',
  family_name: 'Smith',
  email_addresses: [{
    email: '[email protected]',
    field: 'EMAIL1'
  }]
});

// List contacts with pagination
const contacts = await keap.Contact.listContacts({
  limit: 50,
  offset: 0
});

// Search contacts
const searchResults = await keap.Contact.listContacts({
  email: '[email protected]'
});

Working with Products

// Get all products
const products = await keap.Product.listProducts();

// Get a specific product
const product = await keap.Product.getProduct(456);

// Create a new product
const newProduct = await keap.Product.createProduct({
  product_name: 'My Product',
  product_price: 99.99,
  product_short_desc: 'A great product'
});

Working with Tags

// List all tags
const tags = await keap.Tags.listTags();

// Create a new tag
const tag = await keap.Tags.createTag({
  name: 'VIP Customer',
  description: 'High-value customers'
});

// Apply tags to a contact
await keap.Contact.getContact(123).then(contact => 
  contact.applyTags(['vip-customer', 'newsletter'])
);

Error Handling

The client includes built-in error handling and retry logic:

try {
  const contact = await keap.Contact.getContact(123);
} catch (error) {
  console.error('Failed to fetch contact:', error.message);
  // Handle the error appropriately
}

Authentication

You'll need a Keap API key to use this library. You can obtain one by:

  1. Logging into your Keap account
  2. Going to Admin → Settings → Application Settings
  3. Click on "API" in the left sidebar
  4. Generate a new API key

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

See CHANGELOG.md for a detailed list of changes and versions.


Developed by Marcos Reuquen Diaz