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

benji-sdk

v0.1.0

Published

Official TypeScript SDK for the Benji API - Your personal life operating system

Readme

Benji SDK

Official TypeScript SDK for the Benji API - Your personal life operating system.

Installation

npm install benji-sdk
# or
pnpm add benji-sdk
# or
yarn add benji-sdk

Quick Start

import { configure, Todos, Habits } from "benji-sdk";

// Configure with your API key
configure({ apiKey: "your-api-key" });

// List today's todos
const { data } = await Todos.todosList({
  body: { screen: "today" }
});

console.log(data.todos);

Getting Your API Key

  1. Log in to Benji
  2. Go to Settings > API
  3. Generate a new API key

Available Modules

| Module | Description | |--------|-------------| | Todos | Create, list, update, and manage todos | | Habits | Track daily habits | | Mood | Log and retrieve mood entries | | Journal | Create and manage journal entries | | Hydration | Track water intake | | Fasting | Manage fasting windows | | Workouts | Log workouts and exercises | | Projects | Organize todos into projects | | Tags | Categorize items with tags | | Trips | Plan and track travel | | PainEvents | Log pain events for health tracking |

Examples

Todos

import { configure, Todos } from "benji-sdk";

configure({ apiKey: "your-api-key" });

// Create a todo
await Todos.todosCreate({
  body: {
    title: "Buy groceries",
    priority: "high",
    dueDate: "2024-12-25"
  }
});

// List todos for today
const { data } = await Todos.todosList({
  body: { screen: "today" }
});

// Mark as complete
await Todos.todosToggle({
  body: { id: "todo-id" }
});

// Delete a todo
await Todos.todosDelete({
  body: { id: "todo-id" }
});

Habits

import { configure, Habits } from "benji-sdk";

configure({ apiKey: "your-api-key" });

// Create a habit
await Habits.habitsCreate({
  body: {
    name: "Drink 8 glasses of water",
    emoji: "💧"
  }
});

// List all habits
const { data } = await Habits.habitsList();

// Toggle habit completion for today
await Habits.habitsToggle({
  body: { id: "habit-id" }
});

Mood Tracking

import { configure, Mood } from "benji-sdk";

configure({ apiKey: "your-api-key" });

// Log your mood
await Mood.moodCreate({
  body: {
    level: 4,  // 1-5 scale
    notes: "Feeling great today!"
  }
});

// Get mood logs
const { data } = await Mood.moodList();

Journal

import { configure, Journal } from "benji-sdk";

configure({ apiKey: "your-api-key" });

// Create a journal entry
await Journal.journalCreate({
  body: {
    content: "Today was a productive day...",
    title: "Daily Reflection"
  }
});

Custom Base URL

For self-hosted instances or development:

configure({
  apiKey: "your-api-key",
  baseUrl: "https://your-instance.com/api/rest"
});

TypeScript Support

This SDK is written in TypeScript and provides full type definitions for all API endpoints, request bodies, and responses.

import type { TodosListResponse, HabitsCreateData } from "benji-sdk";

Error Handling

import { Todos } from "benji-sdk";

try {
  const { data, error, response } = await Todos.todosGet({
    body: { id: "invalid-id" }
  });

  if (error) {
    console.error("API Error:", error.message);
  }
} catch (err) {
  console.error("Network error:", err);
}

License

MIT