Home > @world-wide-lab/client > Client
Client class
You will need to create an instance of this class to communicate with the World-Wide-Lab server. You can then use the methods of this class to create participants, sessions and responses.
Signature:
export declare class Client
Constructors
Constructor | Modifiers | Description |
---|---|---|
Create a new Client instance |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
Options the Client was created with |
Methods
Method | Modifiers | Description |
---|---|---|
Call an endpoint at the API server | ||
Create a new participant from sractch. Use getParticipant() if you want to get an existing participant or store their id. This function will not keep track of a participant's id. | ||
Create a new Response. See also Session.response() | ||
Start a new Session. If a participant's id is stored, it will be used. see getParticipant(). | ||
Delete the stored participantId. | ||
Get the scores of a leaderboard. | ||
Get a Participant. If someone has already participanted on this machine and their IDs is saved, will return this existing participant. Otherwise, will create a new participant and store the corresponding id. | ||
Get the participantId of the last person that participated using your website (if their id was stored). | ||
Store the participantId of the last person that participated using your website. |