Several files which are needed for developing on MetaMask.
Usually each file or directory contains information about its scope / usage.
To start the Mock Segment API:
- Add/replace the
SEGMENT_HOSTandSEGMENT_WRITE_KEYvariables in.metamaskrcSEGMENT_HOST='http://localhost:9090' SEGMENT_WRITE_KEY='FAKE' - Build the project to the
./dist/folder withyarn dist - Run the Mock Segment API from the command line
node development/mock-segment.js
Events triggered whilst using the extension will be logged to the console of the Mock Segment API.
More information on the API and its usage can be found here.
To debug in a production Segment environment:
- Create a free account on Segment
- Create a New Workspace
- Add a Source (Node.js)
- Copy the
Write Keyfrom the API Keys section under Settings - Add/replace the
SEGMENT_HOSTandSEGMENT_WRITE_KEYvariables in.metamaskrcSEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='COPIED_WRITE_KEY' - Build the project to the
./dist/folder withyarn dist
Events triggered whilst using the extension will be displayed in Segment's Debugger.
To opt in to MetaMetrics;
- Unlock the extension
- Open the Account menu
- Click the
Settingsmenu item - Click the
Security & Privacymenu item - Toggle the
Participate in MetaMetricsmenu option to theONposition
You can inspect the requests in the Network tab of your browser's Developer Tools (background.html)
by filtering for POST requests to /v1/batch. The full url will be http://localhost:9090/v1/batch
or https://api.segment.io/v1/batch respectively.