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.
To run the extension, run the following from the top level of the monorepo:
bun install
bun extension startThen, load the extension into Chrome (if using Webpack):
- Go to chrome://extensions
- At the top right, turn on Developer mode
- Click Load unpacked
- Find and select the extension folder (apps/extension/dev)
To customize the default WXT behavior, create a file web-ext.config.ts in this directory.
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',
],
// ...
});Our scantastic API requires a consistent origin header so the build must be loaded from an absolute path. This works because Chrome generates a consistent ID for the extension based on the path it was loaded from.
To run the extension, run the following from the top level of the monorepo:
Mac:
bun
bun extension start:absoluteWindows:
bun
bun extension start:absolute:windowsThen, load the extension into Chrome (if using Webpack):
- 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 (
/Users/Shared/stretchon Mac andC:/ProgramData/stretchon Windows) - Your chrome extension url should be
chrome-extension://ceofpnbcmdjbibjjdniemjemmgaibeihon Mac andchrome-extension://ffogefanhjekjafbpofianlhkonejcoeon Windows. The backend allows this origin and the ID will be consistently generated based off an absolute path that is consistent on all machines.
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.