{"id":14978474,"url":"https://github.com/glawson/electron-deeplink","last_synced_at":"2025-05-08T00:09:16.490Z","repository":{"id":40461509,"uuid":"286537605","full_name":"glawson/electron-deeplink","owner":"glawson","description":"Node module for Electron apps that sets the default handler for a given protocol (deep links) in both development and production environments.","archived":false,"fork":false,"pushed_at":"2023-11-10T19:15:10.000Z","size":194,"stargazers_count":56,"open_issues_count":1,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T22:15:26.824Z","etag":null,"topics":["electronjs","macos","nodejs"],"latest_commit_sha":null,"homepage":"https://github.com/glawson/electron-deeplink","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glawson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-08-10T17:24:36.000Z","updated_at":"2025-04-01T11:02:26.000Z","dependencies_parsed_at":"2023-11-10T19:46:07.556Z","dependency_job_id":null,"html_url":"https://github.com/glawson/electron-deeplink","commit_stats":{"total_commits":40,"total_committers":5,"mean_commits":8.0,"dds":0.09999999999999998,"last_synced_commit":"e253d9483704b5a7f6fe97b4f51b34b2585a9852"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glawson%2Felectron-deeplink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glawson%2Felectron-deeplink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glawson%2Felectron-deeplink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glawson%2Felectron-deeplink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glawson","download_url":"https://codeload.github.com/glawson/electron-deeplink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569645,"owners_count":21769517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["electronjs","macos","nodejs"],"created_at":"2024-09-24T13:57:45.437Z","updated_at":"2025-05-08T00:09:16.468Z","avatar_url":"https://github.com/glawson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n![ts](https://badgen.net/badge/-/TypeScript?icon=typescript\u0026label\u0026labelColor=blue\u0026color=555555)\n[![glawson](https://circleci.com/gh/glawson/electron-deeplink.svg?style=shield)](https://circleci.com/gh/glawson/electron-deeplink)\n\n# 🚨 Deprecation Notice 🚨\nThe bad news; due to a lack of time and, unfortunitly, no longer directly working with Electrion, I need to deprecate this package.  \nThe good news; @witcher112 has picked up the pieces, and created a better protocol package.  \n\nYou can find it at: [electron-app-universal-protocol-client](https://github.com/witcher112/electron-app-universal-protocol-client)\n\n# electron-deeplink\n\nNode module for Electron apps that sets the default handler for a given protocol (deep links) in both\ndevelopment and production environments.\n\nThis module was inspired due to the lack of protocol support when running non packaged apps on macOS (see [`app.setAsDefaultProtocolClient`](https://www.electronjs.org/docs/api/app#appsetasdefaultprotocolclientprotocol-path-args) for explanation). This module provides full support for running and testing the given protocol in the development environment. It also provides the same protocol support for the production envronment. In other words, protocol management is completly controlled with this module.\n\n# Please Note\n\n-   For Production: While electron-deeplink handles setting `app.setAsDefaultProtocolClient`, you still need to make sure setup the mac bundleId correctly for [electron-builder](https://www.electron.build/configuration/configuration) or [electron-forge](https://www.electronforge.io/configuration).\n\n# Example App\n\nA full working example can be found [here](https://github.com/glawson/electron-deeplink-example)\n\n# Installation\n\n```sh\n# If you use npm:\nnpm install electron-deeplink\n\n# If you use yarn:\n$ yarn add electron-deeplink\n```\n\n# Usage\n\nIn `main.js`, include the `electron-deeplink` module and instantiate the Deeplink class towards to begining of `main.js`.\n\n```js\n// main.js\nconst { app, BrowserWindow } = require('electron');\nconst { Deeplink } = require('electron-deeplink');\nconst isDev = require('electron-is-dev');\n\nlet mainWindow;\nconst protocol = isDev ? 'dev-app' : 'prod-app';\nconst deeplink = new Deeplink({ app, mainWindow, protocol, isDev });\n```\n\nSetup a watch on the deeplink 'received' event\n\n```js\n// main.js\ndeeplink.on('received', (link) =\u003e {\n    // do stuff here\n});\n```\n\n# API\n\n## creating an instance\n\n```js\nconst deeplink = new Deeplink([config]);\n```\n\n## config\n\n```ts\n{\n    // required\n    // type: electron app\n    app: [electron.app]\n\n    // required\n    // type: app.BrowserWindow\n    // Reference to the apps main window\n    mainWindow: [main window reference]\n\n    // required\n    // type: string\n    // String representing the protocol to use. For production, this should be the same as the bundleId set in the build config.\n    protocol: [protocol string]\n\n    // optional, default: false\n    // type: boolean\n    // Represents the app environment\n    isDev: boolean\n\n    // optional, default: false\n    // type: boolean\n    // If true, outputs logging.  Uses electron-log, so files are appened/created for prod.\n    debugLogging: boolean\n\n    // optional, default: '/node_modules/electron/dist/Electron.app'\n    // type: string\n    // String representing the location of Electron relative to the app root.\n    electronPath: [string]\n}\n```\n\n## events\n\n```js\n// 'recieved'\n// When a \"deeplink\" is recieved by the module, this event is emitted.\n\ndeeplink.on('received', (link) =\u003e {\n    // do something here\n});\n```\n\n# Contributors\n\n**This repo uses [semantic-release](https://semantic-release.gitbook.io/) for versioning, which uses [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).**\n\n**semantic-release is hooked up to CircleCI**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglawson%2Felectron-deeplink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglawson%2Felectron-deeplink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglawson%2Felectron-deeplink/lists"}