https://github.com/automata-network/debug-js
a front-end logs collection tool
https://github.com/automata-network/debug-js
Last synced: 4 days ago
JSON representation
a front-end logs collection tool
- Host: GitHub
- URL: https://github.com/automata-network/debug-js
- Owner: automata-network
- License: mit
- Created: 2022-11-07T15:20:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T12:33:26.000Z (over 2 years ago)
- Last Synced: 2025-04-21T01:47:09.810Z (29 days ago)
- Language: TypeScript
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DebugJs
A front-end logs collection tool.
## Install Client
```bash
npm i @automata-network/debug-js-browser -S
```## Use Client
```typescript
const debugJs = new DebugJs({
appName: "example",
collectorUrl: "http://localhost:9000/collect",
logLevel: LogLevel.Info,
requestInterval: 5000,
});debugJs.setUid("johnny");
```## Install Server SDK
```bash
npm i @automata-network/debug-js-server -S
```## Use Client
```js
const { listen } = require("@automata-network/debug-js-server");const { app, router } = listen({
onReceiveLogs: (logs) => {
console.log(logs);
},
});
```## Change Port, Path, Cors And Rate Limit Settings
We are using the `@koa/cors` and `koa-ratelimit`, read their document for more informations.
```js
const { listen } = require("@automata-network/debug-js-server");const { app, router } = listen({
path: "/collect",
port: 9000,
corsOptions: {},
rateLimitOptions: {},
onReceiveLogs: (logs) => {
console.log(logs);
},
});
```