This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
SOLAPI SDK for Node.js - A server-side SDK for sending SMS, LMS, MMS, and Kakao messages (Alimtalk/Friendtalk) in Korea. Compatible with SOLAPI family services (CoolSMS, etc).
# Development
pnpm dev # Watch mode with tsup
pnpm build # Lint + build (production)
pnpm lint # Biome check with auto-fix
# Testing
pnpm test # Run all tests once
pnpm test:watch # Watch mode
pnpm vitest run <path> # Run specific test file
# Documentation
pnpm docs # Generate TypeDoc documentationSolapiMessageService (src/index.ts) is the main SDK entry point. It aggregates all domain services and exposes their methods via delegation pattern using bindServices().
All services extend DefaultService (src/services/defaultService.ts) which provides:
- Base URL configuration (https://api.solapi.com)
- Authentication handling via
AuthenticationParameter - HTTP request abstraction via
defaultFetcher
Domain services:
MessageService/GroupService- Message sending and group managementKakaoChannelService/KakaoTemplateService- Kakao Alimtalk integrationCashService- Balance inquiriesIamService- Block lists and 080 rejection managementStorageService- File uploads (images, documents)
This project uses the Effect library for functional programming and type-safe error handling:
- All errors extend
Data.TaggedErrorwith environment-awaretoString()methods - Use
Effect.genfor complex business logic - Use
pipewithEffect.flatMapfor data transformation chains - Schema validation via Effect Schema for runtime type safety
- Convert Effect to Promise using
runSafePromisefor API compatibility
@models → src/models
@lib → src/lib
@services → src/services
@errors → src/errors
@internal-types → src/types
@ → src
- Never use
anytype - useunknownwith type guards, union types, or Effect Schema - Prefer functional programming style with Effect library
- Run lint after writing code
- Follow Red → Green → Refactor cycle
- Separate structural changes from behavioral changes in commits
- Only commit when all tests pass
- Define errors as Effect Data types (
Data.TaggedError) - Provide concise messages in production, detailed in development
- Use structured logging with environment-specific verbosity
Refactoring specialist applying Kent Beck's "Tidy First?" principles.
Auto-invocation conditions:
- Adding new features or functionality
- Implementing new behavior
- Code review requests
- Refactoring tasks
Core principles:
- Always separate structural changes from behavioral changes
- Make small, reversible changes only (minutes to hours)
- Maintain test coverage
Tidying types: Guard Clauses, Dead Code removal, Pattern normalization, Function extraction, Readability improvements
Works alongside the TDD Approach section's "Separate structural changes from behavioral changes" principle.