Publish a Snap
Snaps are npm packages, so publishing a Snap is as simple as publishing an npm package. Refer to the npm CLI documentation for details on publishing to the public registry. The following details are specific to Snaps:
- The version in
package.json
andsnap.manifest.json
should match. - The
repository.url
field inpackage.json
should match the correct repository for your Snap. - The
source.location.npm.packageName
insnap.manifest.json
should match the name inpackage.json
. - The
proposedName
insnap.manifest.json
should be a human-readable name and should not include the words "MetaMask" or "Snap." - The image specified in
iconPath
in the manifest file is used as the icon displayed when installing the Snap, in custom dialogs, and in the settings menu.- This icon should be a valid SVG.
- The icon will be cropped in a circle when displayed in MetaMask; you do not need to make the icon circular.
After publishing the Snap, any dapp can connect to the Snap by using the Snap ID npm:[packageName]
.
If you are using the Snap monorepo project generated in the quickstart,
make sure to only publish the Snap package in /packages/snap
.
You can use the Snaps Simulator to verify
that your Snap was published correctly — just select localhost in the top right corner and change the
Snap location to npm and the ID of your Snap.
Also, make sure to update the manifest file, icon file, and README to differentiate your Snap from the template.
Make a Snap available to users
After publishing a Snap, you can make it available to MetaMask users by getting your Snap allowlisted. Once allowlisted, anyone can install your Snap in the MetaMask extension.