Node.js library for the Clever API
Clone or download
bgveenstra Merge pull request #58 from Clever/INFRA-3218-circleci-2-migration-cl…

[INFRA-3218] CircleCi 1.0 -> 2.0 migration cleanup
Latest commit 4c422b6 Aug 31, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci rm awscli install; rm report-card; add npm-publish Aug 31, 2018
lib Use v1.2. Jul 7, 2017
test Use v1.2. Jul 7, 2017
.gitignore first commit Dec 17, 2012
LICENSE add license Aug 3, 2014
Makefile Allows running test when no files have changed. Jun 25, 2015 Remove api-key auth (#52) Nov 7, 2016
index.js first commit Dec 17, 2012 mocks: replace understream with highland Jun 6, 2016
package.json 0.11.1 Jul 7, 2017

Clever Javascript Library

Build Status


Via npm:

npm install clever


Clever = require('clever');
var clever = Clever({token: 'YOUR_BEARER_TOKEN'});

If you'd like to play around with our test data, please use the token: DEMO_TOKEN. See our developer guide for more information.

The clever package exposes objects corresponding to resources:

  • District
  • School
  • Section
  • Student
  • Teacher
  • Event

Each exposes a query API that closely resembles that of Mongoose. The available methods are find, findOne, and findById:

clever.District.find({}, function(error, districts) {
  assert(districts[0] instanceof clever.District);
  assert.equal(district.get('name'), 'Demo District');

clever.School.findOne({ name: "Clever Academy" }, function(error, school) {
  assert(school instanceof clever.School);
  assert.equal(school.get('name'), 'Clever Academy');

clever.School.findById('4fee004cca2e43cf27000001', function(error, school) {
  assert(school instanceof clever.School);
  assert.equal(school.get('name'), 'Clever Academy');

When no callback is passed, the methods return a query object that allows you to build up a query over time:

.where('name').equals('Clever Academy')

Query objects also support a stream interface for auto-pagination:

// pull sections 10 at a time
var count = 0;
var stream = clever.Section.find().limit(10).stream();
stream.on('data', function(section) {
  count += 1;
  assert(section instanceof clever.Section);
stream.on('end', function() {
  console.log(count, 'sections loaded');


Questions, feature requests, or feedback of any kind is always welcome! We're available at