Corellium

Corellium

The Corellium API client.

Constructor

new Corellium(options)

Description:
  • Create a new Corellium client.

Source:
Example
const corellium = new Corellium({
    endpoint: 'https://app.corellium.com',
    username: 'username',
    password: 'password',
    totpToken: '123456',
});
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Description
endpoint string

Endpoint URL

apiToken string <nullable>

Login apiToken

username string <nullable>

Login username

password string <nullable>

Login password

token Token <nullable>

Login token

totpToken string <nullable>

Login TOTP (Timebased One Time Password)

Methods

(async) addProjectKey(project, key, kind, labelopt) → {string}

Description:
  • Adds key to the project

Source:
Example
let project = instance.getProjectNamed('TestProject');
instance.addProjectKey(project.id, 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA+eDLGqe+nefGQ2LjvXDlTXDuF33ZHD9wHk/oEICKYd', 'ssh', 'SSH Key');
Parameters:
Name Type Attributes Default Description
project string

project ID

key string

public key, as formatted in a .pub file

kind string ssh

key type ('ssh'/'abd')

label string <optional>
null

key label

Returns:

key ID

Type
string

(async) createProject(name, color, settingsopt) → {Promise.<Project>}

Description:
  • Creates a Project with the given name Color and ProjectSettings.

Source:
Example
corellium.createProject("TestProject");
Parameters:
Name Type Attributes Default Description
name string

project name

color integer 1

color

settings Object <optional>

project settings

Properties
Name Type Description
internet-access boolean
Returns:
Type
Promise.<Project>

(async) createRole(project, grantee, type)

Description:
Source:
Example
instance.createRole(project.id, grantee, 'user');
Parameters:
Name Type Default Description
project string

project ID

grantee User | Team

must be an instance of User or Team

type string user

user ID

(async) createUser() → {Promise.<User>}

Description:
  • Creates a new user in the domain.

    This function is only available to domain administrators.

Source:
Example
let user = await instance.createUser("login", "User Name", "user@email.com", "password");
Returns:
Type
Promise.<User>

(async) deleteProjectKey(project, keyId)

Description:
  • Adds key to the project

Source:
Example
let project = instance.getProjectNamed('TestProject');
instance.deleteProjectKey(project.id, 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
project string

project ID

keyId string

key ID

(async) destroyRole(role)

Description:
Source:
Example
instance.destroyRole(role);
Parameters:
Name Type Description
role Role

role object

(async) destroyUser(id)

Description:
  • Destroys a user in the domain.

    This function is only available to domain administrators.

Source:
Example
instance.destroyUser('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
id string

user ID

(async) files() → {Promise.<Array.<Image>>}

Description:
  • Returns an array of Images that this client is allowed to access.

Source:
Example
let images = await corellium.files();
Returns:
Type
Promise.<Array.<Image>>

(async) generateApiToken() → {string}

Description:
  • Generate an API token to be used with the API. This is non-recoverable, so if it is lost, you must generate a new one.

    This can be used to for the login method by passing it as the apiToken

Source:
Returns:

apiToken

Type
string

(async) getInstance(instanceId) → {Promise.<Instance>}

Description:
  • Attempts to retrieve Instance by iterating through all projects until the instance is found.

Source:
Example
await corellium.instance('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa')
Parameters:
Name Type Description
instanceId string
Returns:
Type
Promise.<Instance>

(async) getProject(projectId) → {Promise.<Project>}

Description:
  • Returns the Project with the given ID.

Source:
Example
let project = await corellium.getProject('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
projectId string

project ID

Returns:
Type
Promise.<Project>

getTeam() → {Promise.<Team>}

Description:
  • Given a team id, returns the Team.

    This function is only available to domain and project administrators.

Source:
Example
let team = await instance.getTeam('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Returns:
Type
Promise.<Team>

(async) getTeamsAndUsers() → {Promise.<{teams: Map.<string, Team>, users: Map.<string, User>}>}

Description:
  • Returns teams and users belonging to the domain.

    This function is only available to administrators.

Source:
Example
let teamsAndUsers = await corellium.getTeamsAndUsers();
Returns:
Type
Promise.<{teams: Map.<string, Team>, users: Map.<string, User>}>

(async) getToken() → {string}

Description:
  • Returns refreshed authentication token

Source:
Example
let token = await corellium.getToken()
Returns:

token

Type
string

getUser() → {Promise.<User>}

Description:
  • Given a user id, returns the User.

    This function is only available to domain and project administrators.

Source:
Example
let user = await instance.getUser('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Returns:
Type
Promise.<User>

(async) login()

Description:
  • Logs into the Corellium API and obtains an authentication token. Does nothing if the current authentication token is up to date.

    Calling this method is not required, as calling any other method that needs an authentication token will do the same thing.

Source:
Example
await corellium.login();

(async) projectKeys(project) → {Array.<ProjectKey>}

Description:
  • Returns all keys for the project

Source:
Example
let keys = instance.projectKeys(project.id);
for(let key of keys)
  console.log(key);
Parameters:
Name Type Description
project string

project ID

Returns:
Type
Array.<ProjectKey>

(async) projectNamed(name) → {Promise.<Project>}

Description:
  • Returns the Project with the given name. If the project doesn't exist, returns undefined.

Source:
Example
let project = await corellium.projectNamed('Default Project');
Parameters:
Name Type Description
name string

project name to match

Returns:
Type
Promise.<Project>

(async) projects() → {Promise.<Array.<Project>>}

Description:
  • Returns an array of Projects that this client is allowed to access.

Source:
Example
let projects = await corellium.projects();
let project = projects.find(project => project.name === "Demo Project");
Returns:
Type
Promise.<Array.<Project>>

(async) removeApiToken()

Description:
  • Remove the currently active api token from this user account.

Source:

(async) roles() → {Promise.<Map.<string, Array.<Role>>>}

Description:
  • Returns Roles belonging to the domain.

    This function is only available to domain and project administrators.

Source:
Example
let roles = await corellium.roles();
Returns:
Type
Promise.<Map.<string, Array.<Role>>>

(async) supported() → {Array.<SupportedDevice>}

Description:
  • Returns supported device list

Source:
Example
let supported = await corellium.supported();
Returns:
Type
Array.<SupportedDevice>

(async) teams() → {Promise.<Map.<string, Team>>}

Description:
  • Returns Teams belonging to the domain.

    This function is only available to domain and project administrators.

Source:
Example
let teams = await corellium.teams();
Returns:
Type
Promise.<Map.<string, Team>>

(async) users() → {Promise.<Map.<string, User>>}

Description:
  • Returns Users belonging to the domain.

    This function is only available to domain and project administrators.

Source:
Example
let users = await corellium.users();
Returns:
Type
Promise.<Map.<string, User>>