{"id":46638328,"url":"https://github.com/tetherto/pearpass-lib-native-messaging-bridge","last_synced_at":"2026-03-08T02:13:38.156Z","repository":{"id":334705170,"uuid":"1113771181","full_name":"tetherto/pearpass-lib-native-messaging-bridge","owner":"tetherto","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-18T06:57:38.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":7,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T11:33:14.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-10T12:49:18.000Z","updated_at":"2026-02-18T06:57:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/pearpass-lib-native-messaging-bridge","commit_stats":null,"previous_names":["tetherto/pearpass-lib-native-messaging-bridge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/pearpass-lib-native-messaging-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-native-messaging-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-native-messaging-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-native-messaging-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-native-messaging-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/pearpass-lib-native-messaging-bridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpearpass-lib-native-messaging-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-08T02:13:37.606Z","updated_at":"2026-03-08T02:13:38.143Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pearpass-lib-native-messaging-bridge\n\nNative messaging bridge for PearPass browser extension. This library enables secure communication between the PearPass browser extension and the PearPass desktop application using Chrome's Native Messaging protocol and IPC (Inter-Process Communication).\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n- [Dependencies](#dependencies)\n- [Related Projects](#related-projects)\n\n## Features\n\n- **Chrome Native Messaging Protocol**: Implements Chrome's native messaging protocol for browser-to-native app communication\n- **IPC Bridge**: Bridges browser extension messages to the PearPass desktop app via IPC\n- **Robust Message Parsing**: Handles Chrome's length header bugs with fallback parsing mechanisms\n- **Cross-Platform Support**: Works on macOS (ARM64), Linux (x64), and Windows (x64)\n- **Command-Based Architecture**: Supports 50+ predefined commands for encryption, vaults, and password management\n- **Connection Status Management**: Monitors and reports desktop app connection status\n- **Secure Handshake**: Implements secure pairing and session management (commands 1100-1105)\n- **Error Handling**: Comprehensive error handling with timeouts and fallback mechanisms\n- **Event-Driven Design**: Uses EventEmitter pattern for clean message handling\n\n## Usage Examples\n\n### Basic Usage\n\n```javascript\nimport { NativeMessagingHost } from 'pearpass-lib-native-messaging-bridge'\n\n// Create and start the native messaging host\nconst host = new NativeMessagingHost()\nawait host.start()\n```\n\n### Command Definitions\n\nThe bridge supports various command categories:\n\n**Encryption Commands** (1001-1004):\n- `encryptionInit`, `encryptionGetStatus`, `encryptionGet`, `encryptionAdd`\n\n**Vaults Commands** (1005-1010):\n- `vaultsInit`, `vaultsGetStatus`, `vaultsGet`, `vaultsList`, `vaultsAdd`, `vaultsClose`\n\n**Active Vault Commands** (1011-1019):\n- `activeVaultInit`, `activeVaultGetStatus`, `activeVaultGet`, `activeVaultList`, `activeVaultAdd`, `activeVaultRemove`, `activeVaultClose`, `activeVaultCreateInvite`, `activeVaultDeleteInvite`\n\n**Password/Key Commands** (1020-1024):\n- `hashPassword`, `encryptVaultKeyWithHashedPassword`, `encryptVaultWithKey`, `getDecryptionKey`, `decryptVaultKey`\n\n**Native Messaging Secure Channel** (1100-1105):\n- `nmGetAppIdentity`, `nmBeginHandshake`, `nmFinishHandshake`, `nmSecureRequest`, `nmCloseSession`\n\n### Message Format\n\nMessages follow the native messaging protocol:\n\n```javascript\n{\n  id: \"unique-message-id\",\n  method: \"vaultsList\",  // or use \"command\"\n  params: {\n    // Command-specific parameters\n  }\n}\n```\n\nResponse format:\n\n**Success Response:**\n```javascript\n{\n  id: \"unique-message-id\",\n  success: true,\n  result: {\n    // Command-specific result data\n  }\n}\n```\n\n**Error Response:**\n```javascript\n{\n  id: \"unique-message-id\",\n  success: false,\n  error: \"Error message\",\n  errorCode: \"ERROR_CODE\"  // Optional error code\n}\n```\n\n### IPC Configuration\n\nThe bridge connects to the desktop app via a socket:\n\n- **Unix/Linux/macOS**: `/tmp/pearpass-native-messaging.sock`\n- **Windows**: `\\\\?\\pipe\\pearpass-native-messaging`\n\n## Dependencies\n\n### Runtime Dependencies\n\n- **pear-ipc** IPC communication with the desktop app\n- **bare-fs** Bare runtime filesystem module\n- **bare-os** Bare runtime operating system utilities\n- **bare-path** Bare runtime path utilities\n- **events** EventEmitter implementation\n\n### Development Dependencies\n\n- **jest** Testing framework\n- **babel-jest** Babel integration for Jest\n- **@babel/core** \u0026 **@babel/preset-env**: Transpilation\n\n### Peer Dependencies\n\n- **tether-dev-docs** Development documentation\n\n## Related Projects\n\n- **PearPass Desktop App**: The main desktop application that manages vaults and encryption\n- **PearPass Browser Extension**: Browser extension that uses this native messaging bridge\n\n## License\n\nApache License 2.0 - See LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpearpass-lib-native-messaging-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fpearpass-lib-native-messaging-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpearpass-lib-native-messaging-bridge/lists"}