Client

new Client(options)

constructor - Create a Kahoot! client.
Parameters:
NameTypeDescription
optionsObjectSets up the client. Options can control what events and methods are available to the client. By default, all options are enabled, besides proxies.

Namespaces

data
defaults
quiz

Methods

answer(choice) → {Promise.<LiveEventTimetrack>}

Answer a question
Parameters:
NameTypeDescription
choiceNumber | String | Array.<Number>The answer to the question - defaults: - 1 answer, number: 0 - multi answer: [0,1,2,3] - "undefined"
Returns:
Resolves when answer is received.
Type: 
Promise.<LiveEventTimetrack>

(async) answerTwoFactorAuth(stepsopt) → {Promise.<LiveEventTimetrack>}

Answer the Two Factor Authentification
Parameters:
NameTypeAttributesDefaultDescription
stepsArray.<Number><optional>
[0,1,2,3]A list of four numbers (0,1,2,3). Each number represents one of the four colors in the two-factor code (red,blue,yellow,green) respectively
Returns:
Resolves when the message is sent and received. Rejects if the message fails to send.
Type: 
Promise.<LiveEventTimetrack>

(async) join(name, teamopt) → {Promise.<Object>}

Join a game. Also joins with team members.
Parameters:
NameTypeAttributesDefaultDescription
nameStringThe name of the player
teamArray.<String> | Boolean<optional>
["Player 1","Player 2","Player 3","Player 4"]The team member names. if false, the team members will not be added automatically.
Returns:
Resolves when join + team (if applicable) succeeds The resolved object should contain information about twoFactor, namerator, and gameMode If joining fails, this will reject with the error
Type: 
Promise.<Object>

(async) joinTeam(teamopt) → {Promise.<LiveEventTimetrack>}

Send team members
Parameters:
NameTypeAttributesDefaultDescription
teamArray.<String><optional>
["Player 1","Player 2","Player 3","Player 4"]A list of team members names
Returns:
Resolves when the team members are sent. Rejects if for some reason the message was not received by Kahoot!'s server.
Type: 
Promise.<LiveEventTimetrack>

leave()

leave - Leave the game.

next()

next - Go to the next part (challenge)

reconnect(pinopt, cidopt)

reconnect to a game
Parameters:
NameTypeAttributesDescription
pinNumber | String<optional>
The gameid to connect to
cidString.<Number> | Number<optional>
The client id to reconnect as

sendFeedback(fun, learn, recommend, overall) → {Promise.<LiveEventTimetrack>}

Send feedback to the host
Parameters:
NameTypeDescription
funNumber1-5. Rating for how fun the quiz was
learnNumber0/1. Whether the client learned anything from the quiz
recommendNumber0/1. Whether the client would recommend the quiz
overallNumber1 - 1. The overall feeling of the client.
Returns:
Resolves when the feedback has been sent.
Type: 
Promise.<LiveEventTimetrack>

(static) defaults() → {class}

Returns:
Returns a new Client constructor which uses new defaults
Type: 
class

(static) join() → {Object}

Properties
NameTypeDescription
clientClientThe newly created client joining the game
eventPromise.<LiveEventTimetrack>See Client#join
Returns:
Returns the Client instead of a Promise.
Type: 
Object

Events

Disconnect

Emitted when the client is disconnected. Emits a String with the reason the client was disconnected.
Type:
  • String

Feedback

Emitted when the host requests for feedback
Type:
  • Object
Properties
NameTypeDescription
quizTypeString

GameReset

Emitted when the host presses "play again" or continues to the next quiz in the list.

Joined

Emitted when the client joins the game
Type:
  • Object
Properties
NameTypeDescription
challengeString.<function()>The challenge function. (Pointless)
nameratorBooleanWhether the game has the friendly name generator on.
participantIdBoolean
smartPracticeBoolean
twoFactorAuthBooleanWhether the game has twoFactorAuth enabled
gameModeString | undefinedIf the gameMode is 'team,' then it is team mode, else it is the normal classic mode.

NameAccept

Emitted when the server has validated the client's name
Type:
  • Object
Properties
NameTypeDescription
playerNameStringThe player's name (may have changed from original value due to filter)
quizTypeString
playerV2Boolean

Podium

Emitted at the end of the game (After "QuizEnd")
Type:
  • Object
Properties
NameTypeDescription
podiumMedalTypeStringA string about the podium medal. "gold", "silver", "bronze" are possible values. May be nonexistent or null.

QuestionEnd

An event emitted at the end of the question. Contains ranking information.
Type:
  • Object
Properties
NameTypeDescription
choiceNumber | Array.<Number> | StringThe answer from the client
typeStringThe question type
isCorrectBooleanWhether the client answered the question correctly
textStringThe text content of answers sent by the client
receivedTimeNumberThe time (ms) when the answer was received
pointsQuestionBooeanWhether the question offered points
pointsNumberThe amount of points earned from the question
correctChoicesArray.<Number>A list of the indexes of correct choices (used in multi select quizzes)
totalScoreNumberThe total score of the client
rankNumberThe current position of the client
pointsDataPointsDataExtra information about the points data
nemesisNemesisThe nemesis

QuestionReady

Emitted when the question is about to start
Type:
  • Object
Properties
NameTypeDescription
questionIndexNumberThe question index
gameBlockTypeStringThe question type
gameBlockLayoutStringThe question layout
quizQuestionAnswersArray.<Number>An array of numbers, signifying the number of answer choices in each question
timeLeftNumberThe time in seconds before the quiz starts

QuestionStart

Emitted when the question starts
Type:
  • Object
Properties
NameTypeDescription
questionIndexNumberThe question index
gameBlockTypeStringThe question type
gameBlockLayoutStringThe layout of the question. May be nonexistent
quizQuestionAnswersArray.<Number>An array of numbers, signifying the number of answer choices in each question
timeAvailableNumberThe time available in the question.

QuizEnd

Emitted when the quiz ends.
Type:
  • Object
Properties
NameTypeDescription
rankNumberThe rank of the player
cidString.<Number>The player id
correctCountNumberThe number of correct answers
incorrectCountNumberThe number of incorrect answers
isKickedBooleanWhether the player was kicked?
isGhostBooleanWhether the player is a ghost.
unansweredCountNumberThe number of unanswered questions.
playerCountNumberThe number of players in the game.
startTimeNumberThe date (ms) when the quiz started.
quizIdStringThe quiz uuid
nameStringThe name of the player
totalScoreNumberThe final score of the player.
hostIdString
challengeIdnull
isOnlyNonPointGameBlockKahootBooleanWhether the kahoot is only non-point questions?

QuizStart

Emitted at the start of the quiz
Type:
  • Object
Properties
NameTypeDescription
quizTypeString
quizQuestionAnswersArray.<Number>A list of numbers stating how many answers are in each question.

RecoveryData

Emitted when the server sends its recovery data. This event is mostly for debugging.

TeamAccept

Emitted when the team members were accepted.
Type:
  • Object
Properties
NameTypeDescription
memberNamesArray.<String>The team members names.
recoveryDataRecoveryDataThe recovery data (contains the current event)

TeamTalk

Emitted when team talk starts
Type:
  • Object
Properties
NameTypeDescription
questionIndexNumberThe current question index
quizQuestionAnswersArray.<Number>A list about the number of choices per question.
gameBlockTypeStringThe question type
gameBlockLayoutStringThe layout of the question
teamTalkDurationNumberThe number (in seconds) for team talk

TimeOver

Emitted when time is over (before QuestionEnd)
Type:
  • Object
Properties
NameTypeDescription
questionNumberNumberThe question index.

TwoFactorCorrect

TwoFactorCorrect Event. Emitted when the two-factor auth was answered correctly. Enables other events to start.

TwoFactorReset

TwoFactorReset Event. Emitted when the two-factor auth resets and hasn't been answered correctly yet

TwoFactorWrong

TwoFactorWrong Event. Emitted when the two-factor auth was answered incorrectly.