lib/credentials/cognito_identity_credentials.js
function getId(callback) {
    var self = this;
    if (typeof self.params.IdentityId === 'string') return callback();

    self.cognito.getId(function(err, data) {
      if (!err && data.IdentityId) {
        self.params.IdentityId = data.IdentityId;
      }
      callback(err, data);
    });
  }
function getId(callback) {
    var self = this;
    if (typeof self.params.IdentityId === 'string') return callback();

    self.cognito.getId(function(err, data) {
      if (!err && data.IdentityId) {
        self.params.IdentityId = data.IdentityId;
      }
      callback(err, data);
    });
  }
Retrieves a Cognito ID, loading from cache if it was already retrieved
on this device.

@note If not loaded explicitly, the Cognito ID is loaded and stored in
localStorage in the browser environment of a device.