Prerequisites
- Node.js 18.0.0 or higher
- Yarn package manager
- Basic TypeScript knowledge
- Jan application installed
Step 1: Set Up Your Project
Clone the Extension Template
Install Dependencies
Step 2: Update package.json
Editpackage.json with your extension details:
package.json
Step 3: Create Your Extension
Editsrc/index.ts:
src/index.ts
Step 4: Build Your Extension
Compile your extension:dist/ folder with your compiled extension.
Step 5: Package Your Extension
Create a.tgz package:
myorg-my-extension-1.0.0.tgz.
Step 6: Install in Jan
- Open Jan application
- Go to Settings > Extensions
- Click Manual Installation
- Select your
.tgzfile - Restart Jan if prompted
Step 7: Verify Installation
Check the console logs (Help > Toggle Developer Tools) to see:Example: Advanced Extension with Settings
Let’s add settings to customize behavior:src/index.ts
Example Extension Types
Inference Extension
Conversational Extension
Debugging Tips
Extension not loading
Extension not loading
- Check the console for errors (Help > Toggle Developer Tools)
- Verify
package.jsonhas correctmainfield pointing todist/index.js - Ensure extension is built:
yarn build - Try reinstalling the extension
Settings not appearing
Settings not appearing
- Verify
registerSettings()is called inonLoad() - Check setting configuration matches
SettingComponentPropsinterface - Restart Jan after installing extension
Events not firing
Events not firing
- Ensure you’re using the correct event name from
@janhq/core - Check that
events.on()is called after Jan finishes loading - Verify event handler function is bound correctly (use arrow functions)
Next Steps
Core API Reference
Explore all available APIs
Building Extensions
Learn packaging and distribution