- Intro
- Features
- Structure
- Getting started
- Install dependency
- Community
- Reference
- Star History
- Contributors
This extension is designed for building browser-based applications integrated with the KeepKey hardware wallet using modern web technologies like React, Typescript, and Vite. The main goal is to provide seamless development and build processes tailored to KeepKey.
For more information, visit KeepKey's website or contact the development team at highlander@keepkey.com.
- React18
- TypeScript
- Tailwindcss
- Vite
- Turborepo
- Prettier
- ESLint
- Chrome Extension Manifest Version 3
- Custom I18n Package
- Custom HMR(Hot Module Rebuild) Plugin
- End to End Testing with WebdriverIO
- When you're using Windows run this:
git config --global core.eol lf
git config --global core.autocrlf input
- Clone this repository.
- Change
extensionDescription
andextensionName
in themessages.json
file. - Install pnpm globally:
npm install -g pnpm
(check your node version >= 18.19.1) - Run
pnpm install
- Run:
- Dev:
pnpm dev
(On windows, you should run as administrator.) - Prod:
pnpm build
- Dev:
- Open in browser -
chrome://extensions
- Check -
Developer mode
- Find and Click -
Load unpacked extension
- Select -
dist
folder at root
- Run:
- Dev:
pnpm dev:firefox
- Prod:
pnpm build:firefox
- Dev:
- Open in browser -
about:debugging#/runtime/this-firefox
- Find and Click -
Load Temporary Add-on...
- Select -
manifest.json
from thedist
folder at root
Remember in Firefox, you add the plugin in temporary mode, meaning it will disappear after each browser close. You'll need to repeat this on every browser launch.
- Run
pnpm i <package> -w
- Run
pnpm i <package> -F <module name>
package
- Name of the package you want to install, e.g., nodemon
module-name
- You can find it inside each package.json
under the key name
, e.g., @extension/content-script
- Copy
.example.env
and paste it as.env
in the same path. - Add a new record inside
.env
. - Add this key with type for value to
vite-env.d.ts
(root) inImportMetaEnv
. - Then you can use it with
import.meta.env.{YOUR_KEY}
as with standard Vite Env.
- Create
.env
inside that package. - Open the related
vite.config.mts
and addenvDir: '.'
at the end of the config. - Follow the same steps as above.
Remember you can't use global and local env for the same package simultaneously (It will be overwritten).
Main app with background script and manifest:
manifest.js
- manifest for the Chrome extension.lib/background
- background script for the Chrome extension (background.service_worker
in manifest.json).public/content.css
- content CSS for page injection.
Some shared packages:
dev-utils
- utils for Chrome extension development (manifest-parser, logger).i18n
- custom i18n package with type safety and validation.hmr
- custom HMR plugin for Vite.shared
- shared code (types, constants, custom hooks, components, etc.).storage
- helpers for Chrome storage API.tailwind-config
- shared Tailwind config.tsconfig
- shared TypeScript config.ui
- components and functions for UI integration.vite-config
- shared Vite config.zipper
- packs thedist
folder intoextension.zip
.e2e
- End-to-end tests with WebdriverIO.
content
- Content script for page interactions.devtools
- DevTools for Chrome extension.new-tab
- New tab for the extension.options
- Options page.popup
- Popup page for the extension.
Join the KeepKey Discord to connect with other developers and share your experiences, suggest features, or get support.
For more information, visit KeepKey's website or reach out at highlander@keepkey.com.