Skip to content
This repository was archived by the owner on Mar 9, 2019. It is now read-only.

Commit a6da72d

Browse files
committed
Update README for new version
1 parent 367b656 commit a6da72d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ A Javascript client library for [statsum](https://github.com/jonasfj/statsum).
88

99
let Statsum = require('statsum');
1010

11-
// Create a project token
12-
let token = Statsum.createToken('my-project', 'SECRET', '24h');
13-
1411
// Create a client object
15-
let statsum = new Statsum({
16-
project: 'my-project',
17-
token: token,
18-
baseUrl: 'https://statsum.example.com',
19-
});
12+
let configurer = async (project) => { return {
13+
project: 'example-project',
14+
baseUrl: 'https://example.com',
15+
token: 'KEY',
16+
expires: new Date().toJSON()
17+
}};
18+
let statsum = new Statsum(configurer, {project: 'test'});
2019

2120
// Send metrics
2221
statsum.count('my-counter', 1);

src/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class StatsumClient extends events.EventEmitter {
1111
/**
1212
* Create a statsum client.
1313
*
14-
* Configurer: A function that returns an object like
14+
* Configurer: A function that must return an object with these specific keys
1515
* ```js
1616
* {
1717
* project: '...', // Project to submit for

0 commit comments

Comments
 (0)