https://github.com/flaque/cognition
human-centric user behavior tooling
https://github.com/flaque/cognition
Last synced: over 1 year ago
JSON representation
human-centric user behavior tooling
- Host: GitHub
- URL: https://github.com/flaque/cognition
- Owner: Flaque
- Created: 2019-03-23T22:02:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-24T17:09:59.000Z (over 7 years ago)
- Last Synced: 2025-01-20T10:13:59.455Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cognition
A cool hackathon project.
Run with:
```sh
yarn dev
```
## Interacting
### Track Calls
These are calls that you can send your user behavior to. The
only thing they record is the timestamp (for usage) and the
anonymous user ID.
```
curl --request POST \
--url http://localhost:3000/api/track \
--header 'content-type: application/json' \
--data '{
"messageId": "test-message-1kehp",
"timestamp": "2019-03-23T20:50:22.449Z",
"type": "track",
"userId": "test-user-eo0zokd"
}'
```
### Usage Reports
This lets you get the usage of an individual user to dynamically
adapt your tool to reduce burnout.
```
curl --request GET \
--url http://localhost:3000/api/usage/test-user-eo0zokd
```
Response:
```
{
"usage": {
"userId": "test-user-eo0zokd",
"totalTime": 30
},
"budget": 20
}
```
### All Usage Reports
This gives you the usage reports of everyone.
```
curl --request GET \
--url http://localhost:3000/api/usages
```
Response:
```
{
"usages": [
{
"userId": "test-user-eo0zokd",
"totalTime": "0"
}
],
"budget": 0
}
```