3.4.6 • Published 3 years ago

seven-ten v3.4.6

Weekly downloads
94
License
MIT
Repository
-
Last release
3 years ago

Seven-Ten Client

Client for Seven-Ten

Build Status

Getting started

# clone the repository and install the dependencies
git clone https://github.com/zooniverse/Seven-Ten-Client.git
cd Seven-Ten-Client
npm install .
  • Run the tests with npm test
  • Lint the code with npm run lint
  • Release a version with npm run version, also
    • Transpiles the source
    • Tags a release

Client usage

Client

Communicates with the API.

Client.config = {
  host: 'https://seven-ten-staging.zooniverse.org', // The API host
  headers: zooAPI.headers // Headers (e.g. Authentication) to send with requests
};

Client.current(); // Provides a singleton client instance
Split

Manages the current splits

Split.load('owner/project-name').then((splits) => {
  // ...
}); // Load all active splits by project slug

// To create metric-tracking events for splits;
Split.classificationCreated(classification);
// or
Split.classifierVisited();

Component usage

TextSplit

Provides a component that displays a text split.

splitKey corresponds to split.key

textKey corresponds to the property storing text in variant.value

<TextSplit
  splitKey="landing.text"
  textKey="description"
  splits={this.props.splits}
  default="The default description"
/>
VisibilitySplit

Provides a component that toggles element visibility

splitKey corresponds to split.key

elementKey corresponds to the property storing the on/off boolean in variant.value

<VisibilitySplit
  splitKey="mini-course.visible"
  elementKey="button"
  splits={this.props.splits}
>
  <p>This will be shown if it's visible, otherwise it won't</p>
</VisibilitySplit>
3.4.6

3 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

4 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.2

6 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago