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.jsonandsnap.manifest.jsonshould match. - The
repository.urlfield inpackage.jsonshould match the correct repository for your Snap. - The
source.location.npm.packageNameinsnap.manifest.jsonshould match the name inpackage.json. - The
proposedNameinsnap.manifest.jsonshould be a human-readable name and should not include the words "MetaMask" or "Snap." - The image specified in
iconPathin 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.
- The icon should only have a transparent background if the icon is clearly visible on both light and dark backgrounds.
After publishing the Snap, any dapp can connect to the Snap by using the Snap ID npm:[packageName].
You can use the Snap Install Tester with MetaMask Flask to verify that your Snap package was published correctly.
If you are using the Snap monorepo project generated in the quickstart,
make sure to only publish the Snap package in /packages/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.