Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
The SecurityManager class provides APIs to interact with privileges.

Constructors

new SecurityManager()

new SecurityManager(): SecurityManager

Returns

SecurityManager

Methods

getCurrentContextCredential()

static getCurrentContextCredential(): SecurityManagerTypes.ICredential

Returns

SecurityManagerTypes.ICredential

getMajorVersion()

static getMajorVersion(): number Get the major version number. The major version number.

Returns

number

getMinorVersion()

static getMinorVersion(): number Get the minor version number. The minor version number.

Returns

number

getPatchVersion()

static getPatchVersion(): number Get the patch version number. The patch version number.

Returns

number

getPrivilegeState()

static getPrivilegeState(privilege: string, packageId?: string | undefined): Promise<SecurityManagerTypes.PrivilegeState>

Parameters

privilege
string
packageId?
string | undefined

Returns

Promise<SecurityManagerTypes.PrivilegeState>

getRuntimePrivilegeStates()

static getRuntimePrivilegeStates(credential: SecurityManagerTypes.ICredential): Promise<SecurityManagerTypes.IRuntimePrivilege[]>

Parameters

credential
SecurityManagerTypes.ICredential

Returns

Promise<SecurityManagerTypes.IRuntimePrivilege[]>

requestPrivilege()

static requestPrivilege(privilege: string): Promise<SecurityManagerTypes.PrivilegeState> Request permission to use a run-time privilege

Parameters

privilege
string The run-time privilege to request access to.

Returns

Promise<SecurityManagerTypes.PrivilegeState> PromiseSecurityManagerTypes.PrivilegeState On success, the promise is resolved with the new state of the privilege for the calling package. On error, the promise is rejected with one of the following error messages:
  • “Failed to get privilege state” - An error occurred retrieving the new privilege state
  • “Failed to launch privilege request handler” - An error occurred while attempting to launch a system component to get the user’s consent

requestPrivileges()

static requestPrivileges(privileges: string[]): Promise<boolean[]>

Parameters

privileges
string[]

Returns

Promise<boolean[]>

setPrivilegeState()

static setPrivilegeState(packageId: string, privilege: string, state: SecurityManagerTypes.PrivilegeState): Promise<string> Sets the run-time privilege to a certain state for a specified package.

Parameters

packageId
string The packageId value of the specified package.
privilege
string The run-time privilege to modify.
state
SecurityManagerTypes.PrivilegeState State to set the run-time privilege to.

Returns

Promise<string> Promise On success, the promise is resolved. On error, the promise is rejected with the error message: “Failed to set privilege state.”

setRuntimePrivilegeStates()

static setRuntimePrivilegeStates(credential: SecurityManagerTypes.ICredential, states: SecurityManagerTypes.IRuntimePrivilege[]): Promise<void>

Parameters

credential
SecurityManagerTypes.ICredential
states
SecurityManagerTypes.IRuntimePrivilege[]

Returns

Promise<void>
Last modified on July 22, 2026