Base template to build your own Allow2Automate plugins quickly and easily.
This is the official template for creating custom Allow2Automate plugins. It provides a complete development environment with build tools, example code, and best practices to help you create professional plugins that integrate with the Allow2 parental control ecosystem.
- Complete plugin development scaffold
- Pre-configured build system with Rollup
- React component examples
- Material-UI integration
- Babel transpilation for modern JavaScript
- Example actions and triggers
- Development server with hot reload
- Production-ready build configuration
- Comprehensive documentation structure
npm install @allow2/allow2automate-plugingit clone https://github.com/Allow2/allow2automate-plugin.git
cd allow2automate-plugin
npm install
npm run build- Clone this template repository
- Update
package.jsonwith your plugin details - Modify the
allow2automatesection with your plugin metadata - Implement your plugin logic in
src/index.js - Create UI components in
src/components/ - Build and test your plugin
allow2automate-plugin/
├── src/
│ ├── index.js # Main plugin entry point
│ ├── components/ # React components
│ └── utils/ # Utility functions
├── dist/ # Built plugin files
├── examples/ # Example usage
├── package.json # Plugin metadata
└── rollup.config.js # Build configuration
Update the allow2automate section in package.json:
{
"allow2automate": {
"plugin": true,
"pluginId": "your-plugin-id",
"displayName": "Your Plugin Name",
"category": "Your Category",
"permissions": ["permission1", "permission2"],
"minAppVersion": "2.0.0",
"api": {
"actions": [...],
"triggers": [...]
}
}
}This template includes:
- configuration: To read and modify plugin settings
Customize permissions based on your plugin's needs:
- network: For external API calls
- filesystem: For file operations
- system: For system-level operations
export const actions = {
myAction: async (params) => {
// Your action logic here
return { success: true };
}
};export const triggers = {
myTrigger: {
subscribe: (callback) => {
// Set up event listener
// Call callback(data) when event occurs
},
unsubscribe: () => {
// Clean up event listener
}
}
};import React from 'react';
import { Button } from '@material-ui/core';
export const ConfigPanel = () => {
return (
<div>
<h2>Plugin Configuration</h2>
<Button variant="contained" color="primary">
Configure
</Button>
</div>
);
};- Name: Configure Plugin
- Description: Configure plugin settings
- Parameters:
settings(object): Plugin configuration object
- Name: State Changed
- Description: Triggered when plugin state changes
- Payload:
state(object): New plugin statepreviousState(object): Previous plugin state
# Clone the template
git clone https://github.com/Allow2/allow2automate-plugin.git your-plugin-name
cd your-plugin-name
# Install dependencies
npm install
# Start development server with hot reload
npm start
# Build for production
npm run build
# Run tests
npm test
# Deploy example
npm run deployThe template includes a complete build pipeline:
- Development:
npm start- Watch mode with hot reload - Production:
npm run build- Optimized build - Testing:
npm test- Run test suite
The build process generates:
dist/index.js- CommonJS moduledist/index.es.js- ES6 module
- Update version in
package.json - Build the plugin:
npm run build - Publish to npm:
npm publish - Submit to Allow2 plugin directory
- Follow the existing code structure
- Write comprehensive tests
- Document all actions and triggers
- Use meaningful error messages
- Implement proper error handling
- Keep dependencies minimal
- Follow semantic versioning
- Node.js 12.0 or higher
- Allow2Automate 2.0.0 or higher
- React 16.12.0 or higher
- Material-UI 4.11.3 or higher
MIT - See LICENSE file for details
- Issues: GitHub Issues
- Documentation: Allow2 Documentation
- Plugin Development Guide: Allow2 Plugin Guide
- Community: Allow2 Community Forums
Contributions to improve this template are welcome! Please submit pull requests with improvements.
Allow2
allow2automate, allow2, template, plugin, starter, development