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

@cronlet/sdk

v0.1.0

Published

Official SDK for Cronlet Cloud - scheduled tasks for AI agents and automation

Readme

@cronlet/sdk

Official SDK for Cronlet Cloud - scheduled tasks for AI agents and automation.

Installation

npm install @cronlet/sdk

Quick Start

import { CloudClient } from '@cronlet/sdk';

const cronlet = new CloudClient({
  apiKey: process.env.CRONLET_API_KEY!,
});

// Create a scheduled task
const task = await cronlet.tasks.create({
  name: 'Daily Report',
  handler: {
    type: 'webhook',
    url: 'https://api.example.com/report',
    method: 'POST',
  },
  schedule: 'daily at 9am',
  timezone: 'America/New_York',
});

// List all tasks
const tasks = await cronlet.tasks.list();

// Trigger a task manually
await cronlet.tasks.trigger(task.id);

// Pause/resume
await cronlet.tasks.pause(task.id);
await cronlet.tasks.resume(task.id);

// View run history
const runs = await cronlet.runs.list(task.id);

AI Agent Integration

The SDK includes pre-formatted tool definitions for OpenAI, Anthropic, and LangChain.

OpenAI

import OpenAI from 'openai';
import { CloudClient, cronletTools, createToolHandler } from '@cronlet/sdk';

const openai = new OpenAI();
const cronlet = new CloudClient({ apiKey: process.env.CRONLET_API_KEY! });
const handler = createToolHandler(cronlet);

const response = await openai.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Schedule a daily report at 9am' }],
  tools: cronletTools.openai,
});

// Handle tool calls
for (const toolCall of response.choices[0].message.tool_calls ?? []) {
  const result = await handler.handleOpenAI(toolCall);
  console.log(result);
}

Anthropic

import Anthropic from '@anthropic-ai/sdk';
import { CloudClient, cronletTools, createToolHandler } from '@cronlet/sdk';

const anthropic = new Anthropic();
const cronlet = new CloudClient({ apiKey: process.env.CRONLET_API_KEY! });
const handler = createToolHandler(cronlet);

const response = await anthropic.messages.create({
  model: 'claude-3-opus-20240229',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Schedule a weekly digest every Monday' }],
  tools: cronletTools.anthropic,
});

// Handle tool use
for (const block of response.content) {
  if (block.type === 'tool_use') {
    const result = await handler.handleAnthropic(block);
    console.log(result);
  }
}

LangChain

import { DynamicStructuredTool } from '@langchain/core/tools';
import { CloudClient, langchainTools, createToolHandler } from '@cronlet/sdk';

const cronlet = new CloudClient({ apiKey: process.env.CRONLET_API_KEY! });
const handler = createToolHandler(cronlet);

const tools = langchainTools.map(
  (tool) =>
    new DynamicStructuredTool({
      name: tool.name,
      description: tool.description,
      schema: tool.schema,
      func: async (args) => {
        const result = await handler.execute(tool.name, args);
        return JSON.stringify(result);
      },
    })
);

API Reference

Tasks

// Create a task
cronlet.tasks.create(input)

// List all tasks
cronlet.tasks.list()

// Get a task by ID
cronlet.tasks.get(taskId)

// Update a task
cronlet.tasks.patch(taskId, updates)

// Delete a task
cronlet.tasks.delete(taskId)

// Trigger immediate execution
cronlet.tasks.trigger(taskId)

// Pause scheduled runs
cronlet.tasks.pause(taskId)

// Resume a paused task
cronlet.tasks.resume(taskId)

Runs

// List runs (optionally filter by task)
cronlet.runs.list(taskId?, limit?)

// Get a specific run
cronlet.runs.get(runId)

Secrets

// List secrets (values masked)
cronlet.secrets.list()

// Create a secret
cronlet.secrets.create({ name: 'SLACK_TOKEN', value: 'xoxb-...' })

// Delete a secret
cronlet.secrets.delete(name)

Usage

// Get current usage
cronlet.usage.get()

Schedule Formats

Cronlet supports natural language schedules:

// Interval
'every 15 minutes'
'every 2 hours'

// Daily
'daily at 9am'
'daily at 09:00, 17:00'

// Weekly
'every monday at 9am'
'weekdays at 9am'

// Monthly
'monthly on the 1st at 9am'
'monthly on the last day at midnight'

// Cron (if you prefer)
'0 9 * * 1-5'  // Weekdays at 9am

Error Handling

import { CronletError } from '@cronlet/sdk';

try {
  await cronlet.tasks.get('nonexistent');
} catch (error) {
  if (error instanceof CronletError) {
    console.log(error.message); // "Task not found"
    console.log(error.code);    // "NOT_FOUND"
    console.log(error.status);  // 404
  }
}

License

MIT