You must declare the "management" permission in the extension manifest to use the management API. For example:
{
"name": "My extension",
...
"permissions": [
"management"
],
...
}
$(ref:management.getPermissionWarningsByManifest), $(ref:management.uninstallSelf), and $(ref:management.getSelf) do not require the management permission.