Skip to main content

Request permissions

To access certain powerful JavaScript globals or API methods, a snap must ask the user for permission. Snaps follow the EIP-2255 wallet permissions specification, and you must specify a snap's required permissions in the initialPermissions field of the manifest file.

RPC API permissions

You must request permission to use any restricted JSON-RPC API methods.

For example, to request to use snap_dialog, add the following to the manifest file:

"initialPermissions": {
"snap_dialog": {}
},

Endowments

Endowments are a type of permission. See the Snaps permissions reference for the full list of endowments you can specify in the manifest file.

For example, to request the endowment:long-running permission, add the following to the manifest file:

"initialPermissions": {
"endowment:long-running": {}
},