@usageflow/core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @usageflow/core
|
|
2
|
+
|
|
3
|
+
Core functionality for UsageFlow API tracking. This package provides the base implementation for tracking API usage across different Node.js frameworks.
|
|
4
|
+
|
|
5
|
+
⚠️ **Beta Version Notice**: This package is currently in beta. Early adopters may encounter issues. We appreciate your feedback and contributions!
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @usageflow/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
This is the core package that provides base functionality for UsageFlow integrations. You typically won't use this package directly, but rather through framework-specific implementations:
|
|
16
|
+
|
|
17
|
+
- [@usageflow/express](https://www.npmjs.com/package/@usageflow/express) for Express.js
|
|
18
|
+
- [@usageflow/fastify](https://www.npmjs.com/package/@usageflow/fastify) for Fastify
|
|
19
|
+
- [@usageflow/nestjs](https://www.npmjs.com/package/@usageflow/nestjs) for NestJS
|
|
20
|
+
|
|
21
|
+
If you need to extend UsageFlow for a different framework, you can use this core package as your starting point.
|
|
22
|
+
|
|
23
|
+
## API Reference
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
class UsageFlowAPI {
|
|
27
|
+
init(apiKey: string, usageflowUrl?: string): void;
|
|
28
|
+
createRoutesMap(routes: Route[]): Map<string, Set<string>>;
|
|
29
|
+
shouldMonitorRoute(
|
|
30
|
+
method: string,
|
|
31
|
+
url: string,
|
|
32
|
+
routesMap: Map<string, Set<string>>
|
|
33
|
+
): boolean;
|
|
34
|
+
shouldSkipRoute(
|
|
35
|
+
method: string,
|
|
36
|
+
url: string,
|
|
37
|
+
whitelistMap: Map<string, Set<string>>
|
|
38
|
+
): boolean;
|
|
39
|
+
sanitizeHeaders(headers: Record<string, string>): Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Beta Status
|
|
44
|
+
|
|
45
|
+
This is a beta release meant for early adopters. You may encounter:
|
|
46
|
+
|
|
47
|
+
- API changes in future versions
|
|
48
|
+
- Incomplete features
|
|
49
|
+
- Potential bugs
|
|
50
|
+
|
|
51
|
+
We're actively working on improvements and appreciate your feedback!
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|