async function getInactiveUsers(users = [], nextPageToken) {
  const result = await admin.auth().listUsers(1000, nextPageToken);
  // Find users that have not signed in in the last 30 days.
  const inactiveUsers = result.users.filter(
      (user) =>
        Date.parse(
            user.metadata.lastRefreshTime || user.metadata.lastSignInTime,
        ) <
      Date.now() - 30 * 24 * 60 * 60 * 1000,
  );

  // Add to the list of previously found inactive users.
  users = users.concat(inactiveUsers);

  // If there are more users to fetch we fetch them.
  if (result.pageToken) {
    return getInactiveUsers(users, result.pageToken);
  }

  return users;
}
@param {admin.auth.UserRecord[]} [users] the current list of inactive users
@param {string} [nextPageToken]
@return {Promise<admin.auth.UserRecord[]>}