Prerequisites
Before installing the Atomemo Plugin SDK, ensure you have the following:Bun Runtime
Bun Runtime
The SDK is optimized for Bun, a fast JavaScript runtime.Install Bun:Verify installation:
While Node.js 18+ is supported, Bun is recommended for the best performance and developer experience.
TypeScript (Optional)
TypeScript (Optional)
TypeScript is recommended for type safety and better IDE support.The SDK includes TypeScript definitions, so no additional installation is needed.
Atomemo Hub Access
Atomemo Hub Access
Youโll need access to an Atomemo Hub instance for testing your plugin.Required environment variables:
HUB_WS_URL- WebSocket URL of your Hub instanceHUB_DEBUG_API_KEY- API key for debug mode (development only)
Install the SDK
Initialize the project
Initialize a new project with Bun:This creates a
package.json and basic project structure.Install the SDK and dependencies
Install the Atomemo Plugin SDK and required peer dependencies:
Peer Dependencies:
chalk(v5) - Terminal stylingdotenv(v17) - Environment variable managementzod(v4) - Schema validation
Project Structure
Set up your project with the following structure:Environment Configuration
Create a.env file in your project root to configure the SDK:
.env
- Development
- Production
For local development, use debug mode:
TypeScript Configuration
If youโre using TypeScript, create atsconfig.json:
tsconfig.json
Package.json Scripts
Add these scripts to yourpackage.json for development:
package.json
Verify Installation
Create a minimal plugin to verify your setup:src/index.ts
Your development environment is now ready! Proceed to the quickstart guide to build your first plugin.
Troubleshooting
Module not found errors
Module not found errors
Ensure all peer dependencies are installed:
WebSocket connection errors
WebSocket connection errors
Verify your The URL should start with
HUB_WS_URL is correct and the Hub instance is running:ws:// or wss://.Authentication errors in debug mode
Authentication errors in debug mode
Make sure
HUB_DEBUG_API_KEY is set in your .env file:TypeScript errors
TypeScript errors
Run type checking to identify issues:Ensure
@types/bun is installed if youโre using Bun-specific APIs.Definition.json errors in release mode
Definition.json errors in release mode
In release mode, the SDK expects a
definition.json file with author information:definition.json
Next Steps
Quick Start
Build your first working plugin
API Reference
Explore the complete SDK API
Optional: Biome for Linting
The SDK uses Biome for linting and formatting. To use it in your project:biome.json configuration:
biome.json
package.json: