electron-api

Implement secure, type-safe IPC channels for Electron applications.

1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/MichaelCrowe11/crowe-terminal --skill electron-api-michaelcrowe11
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: electron-api
Source: https://github.com/MichaelCrowe11/crowe-terminal/tree/main/.kilocode/skills/electron-api
Command: npx skills add https://github.com/MichaelCrowe11/crowe-terminal --skill electron-api-michaelcrowe11

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a structured method to implement Electron main and renderer process communication via IPC, simplifying cross-process function calls and event handling.

Core Features & Use Cases

  • IPC Pattern Implementation: Supports sync, async, and fire-and-forget message protocols between renderer and main processes.
  • TypeScript Type Definitions: Defines clear interfaces for Electron APIs, facilitating type-safe integrations.
  • Use Case: Developers adding new Electron features can follow this guide to expose native OS functions securely within their application, such as capturing screenshots or opening external links.

Quick Start

Define a new Electron API method following the pattern provided, then implement its handler and expose it through preload scripts to enable seamless communication.

Frequently Asked Questions about electron-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up type-safe Electron IPC communication between main and renderer processes?

Type-safe Electron IPC communication is established by defining clear TypeScript interfaces for your API and implementing handlers in the main process exposed securely through preload scripts. This structure simplifies cross-process function calls and event handling.

What is the best way to expose native OS functions securely in an Electron app?

Exposing native OS functions securely in an Electron app requires defining a new API method, implementing its handler in the main process, and selectively exposing it via preload scripts. This pattern safely extends native capabilities like capturing screenshots to the renderer.

Does this Electron IPC guide support both synchronous and asynchronous message protocols?

Yes, the Electron IPC implementation supports synchronous, asynchronous, and fire-and-forget message protocols between renderer and main processes. This allows developers to choose the appropriate communication pattern for their specific application needs.

How do I implement an Electron preload script to handle inter-process communication?

Implementing an Electron preload script for IPC involves defining the API interface and exposing the main process handlers to the renderer. Following the provided pattern ensures seamless and secure inter-process communication across your application.

Why do I need TypeScript type definitions for my Electron API?

TypeScript type definitions are needed for your Electron API to facilitate type-safe integrations and ensure robust front-end and back-end communication. Defining clear interfaces prevents runtime errors when calling main process functions from the renderer.