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 🙏

© 2025 – Pkg Stats / Ryan Hefner

codeapp_code_sdk

v1.8.2

Published

CodeApp SDK: wrap the Claude Code CLI as an API for sandboxed automation

Readme

CodeApp SDK

Use Claude Code as an LLM provider with your Claude Code subscription flat fee instead of pay-per-token API keys.

Installation

npm install codeapp_code_sdk

Quick Start

1. Create a new project

npx codeapp-sdk init my-app
cd my-app
npm install
npm start

2. Open in browser

Visit http://localhost:3000 to see the chat interface.

3. Test the API

curl -X POST http://localhost:3000/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello Claude!"}'

Features

  • 💰 Flat Fee: Use your Claude Code Max subscription for unlimited LLM usage
  • 🚀 No Token Counting: Stop worrying about API costs
  • 🔌 Simple Integration: Drop-in SDK for any JavaScript/TypeScript project
  • 🌐 WebSocket Support: Built-in Socket.io integration for real-time applications
  • 📦 CLI Tool: Quick project scaffolding with codeapp-sdk init
  • 🔄 Streaming Support: Real-time response streaming with AsyncGenerator

Usage

Basic SDK Usage

import { ClaudeCodeSDK } from 'codeapp_code_sdk'

const sdk = new ClaudeCodeSDK()

// Simple prompt
const response = await sdk.executeWithClaudeCode('Hello, Claude!')
console.log(response.messages[0].content)

// With options
const response = await sdk.executeWithClaudeCode('Explain quantum computing', {
  modelId: 'sonnet',     // or 'opus', 'haiku'
  maxTokens: 1000,
  temperature: 0.7
})

Streaming Responses

const stream = sdk.streamWithClaudeCode('Write a story...')
for await (const chunk of stream) {
  process.stdout.write(chunk)
}

WebSocket Server

import { ClaudeCodeWebSocketServer } from 'codeapp_code_sdk'

const server = new ClaudeCodeWebSocketServer({ port: 8080 })
// Connect with ws://localhost:8080

Socket.io Integration

import { createServer } from 'http'
import { ClaudeCodeSocketIOServer } from 'codeapp_code_sdk'

const httpServer = createServer()
const claudeServer = new ClaudeCodeSocketIOServer(httpServer)

httpServer.listen(3000)

API Reference

ClaudeCodeSDK

new ClaudeCodeSDK(options?)

  • options.debug: Enable debug logging (default: false)

executeWithClaudeCode(prompt, options?)

  • prompt: The input prompt string
  • options.modelId: Model to use ('sonnet', 'opus', 'haiku')
  • options.maxTokens: Maximum tokens to generate
  • options.temperature: Temperature for generation (0-1)
  • options.systemPrompt: System prompt (can include '--continue' for conversation continuity)

Returns: Promise<ClaudeCodeResponse>

streamWithClaudeCode(prompt, options?)

Returns: AsyncGenerator<string> for streaming responses

stopCurrentProcess()

Stops the current Claude Code process if running.

getCurrentConversationId()

Returns the current conversation ID for continuity.

CLI Commands

  • codeapp-sdk init [project-name] - Create a new CodeApp SDK project
  • codeapp-sdk check - Verify Claude Code installation
  • codeapp-sdk serve [--port --token ...] - Start middleware service
  • codeapp-sdk help - Show help information

Requirements

  • Node.js >= 18.0.0
  • Claude Code CLI installed and authenticated
  • Active Claude Code subscription

Debugging

Common Issues

  1. "Claude Code not found": Make sure Claude Code CLI is installed and in your PATH
  2. "Failed to connect": Ensure the server is running (npm start)
  3. CORS errors: The server includes CORS support by default
  4. Model errors: Not all models may be available with your subscription

Debug Mode

Enable debug logging to see detailed information:

const sdk = new ClaudeCodeSDK({ debug: true })

License

MIT

Contributing

See CONTRIBUTING.md

Links