Skip to content

Home > @world-wide-lab/client

client package

A small package to directly interact with the World-Wide-Lab API.

Remarks

If you use one of the libraries with a supported integration package, you may not need this package.

Classes

Class

Description

Client

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.

Participant

A World-Wide-Lab participant, typically used to link multiple Sessions.

Session

A world-wide-lab session, corresponding to a person's participation in a study. Use this class to capture responses.

WorldWideLabError

Functions

Function

Description

oneMonthAgo()

Helper function to return the date exactly one month ago.

For use with Client.getLeaderboardScores().

oneWeekAgo()

Helper function to return the date exactly one week ago.

For use with Client.getLeaderboardScores().

oneYearAgo()

Helper function to return the date exactly one year ago.

For use with Client.getLeaderboardScores().

Interfaces

Interface

Description

ClientOptions

Options to create a new Client instance

ClientParticipantUpdateOptions

Options to update an existing Participant.

ClientResponseOptions

Options to create a new Response

ClientSessionOptions

Options to create a new Session

ClientSessionUpdateOptions

Options to update an existing Session.

GetLeaderoardScoresOptions

Options to get scores from a leaderboard when using Client.getLeaderboardScores()

LeaderboardScoreData

A record of data to add to a leaderboard with Session.addScoreToLeaderboard()

Variables

Variable

Description

VERSION

Type Aliases

Type Alias

Description

ClientParticipantOptions

Options to create a new Participant

HTTPMethod

HTTP method to use for a request

LeaderboardScores

Data returned when getting scores from a leaderboard with Client.getLeaderboardScores()