Before running the extension, you need to get the environment variables from 1password in order to get full functionality. Run the command bun extension env:local:download to copy them to your root folder.
The extension supports two build systems during the migration from Webpack to WXT:
- WXT (new) - Preferred for local development. Opens browser automatically.
- Webpack (legacy) - Still used for production builds during the transition.
First, install dependencies from the top level of the monorepo:
bun installbun extension devWXT automatically opens a browser window with the extension loaded.
To customize the browser WXT opens, create a file web-ext.config.ts in this directory:
// web-ext.config.ts
import { defineWebExtConfig } from 'wxt';
export default defineWebExtConfig({
// Option 1: Connect to already running Chrome (requires Chrome to be started with --remote-debugging-port=9222)
// chromiumPort: 9222,
// Option 2: Use your existing Chrome profile (but Chrome must be closed first)
// chromiumArgs: [
// '--user-data-dir=/Users/<username>/Library/Application Support/Google/Chrome',
// '--profile-directory=Default'
// ],
// Option 3: Create a persistent profile that matches your existing setup (recommended)
chromiumArgs: [
'--user-data-dir=./.wxt/chrome-data',
// Sync with your Google account to get bookmarks, extensions, etc.
// '--enable-sync',
],
});# Mac
bun extension start:absolute
# Windows
bun extension start:absolute:windowsbun extension start:webpackThen manually load the extension into Chrome:
- Go to chrome://extensions
- At the top right, turn on Developer mode
- Click Load unpacked
- Find and select the extension folder (
apps/extension/dev)
Our Scantastic API requires a consistent origin header, so the build must be loaded from an absolute path. Chrome generates a consistent extension ID based on the path it was loaded from.
# Mac
bun extension start:webpack:absolute
# Windows
bun extension start:webpack:absolute:windowsThen manually load the extension into Chrome:
- Go to chrome://extensions
- At the top right, turn on Developer mode
- Click Load unpacked
- Find and select the extension folder with an absolute path:
- Mac:
/Users/Shared/stretch - Windows:
C:/ProgramData/stretch
- Mac:
- Your extension URL should be:
- Mac:
chrome-extension://ceofpnbcmdjbibjjdniemjemmgaibeih - Windows:
chrome-extension://ffogefanhjekjafbpofianlhkonejcoe
- Mac:
The backend allows these origins, and the ID is consistently generated based on the absolute path.
We use redux-persist to persist the Redux state between user sessions. Most of this state is shared between the mobile app and the extension. Please review the Wallet Migrations README for details on how to write migrations when you add or remove anything from the Redux state structure.