when i run this code i get error admin is not defined :     how to retrieve user list from fire base authentication i want to retrieve all register user list how. when i using list user function then message is admin is not define. i am using this function

    function listAllUsers(nextPageToken) {
      admin.auth().listUsers(1000, nextPageToken)
        .then(function(listUsersResult) {
          listUsersResult.users.forEach(function(userRecord) {
            console.log('user', userRecord.toJSON());
          });
          if (listUsersResult.pageToken) {
            listAllUsers(listUsersResult.pageToken);
          }
        })
        .catch(function(error) {
          console.log('Error listing users:', error);
        });
    }

i am using thsi code to get all user list from firebase auth but i can not get it. error will be admin is not define 