beatlyze 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 +30 -24
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,30 +13,34 @@ npm install beatlyze
|
|
|
13
13
|
```javascript
|
|
14
14
|
const { Beatlyze } = require("beatlyze");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
console.log(result.
|
|
22
|
-
console.log(result.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
(async () => {
|
|
17
|
+
const bz = new Beatlyze("bz_your_api_key");
|
|
18
|
+
|
|
19
|
+
// Analyze from URL (waits for result by default)
|
|
20
|
+
const result = await bz.analyzeUrl("https://example.com/track.mp3");
|
|
21
|
+
console.log(result.bpm); // 128.4
|
|
22
|
+
console.log(result.key); // "A"
|
|
23
|
+
console.log(result.energy);
|
|
24
|
+
|
|
25
|
+
// Submit without waiting
|
|
26
|
+
const job = await bz.analyzeUrl("https://example.com/track.mp3", { wait: false });
|
|
27
|
+
console.log(job.job_id);
|
|
28
|
+
|
|
29
|
+
// Check result later
|
|
30
|
+
const analysis = await bz.getAnalysis(job.job_id);
|
|
31
|
+
console.log(analysis.status);
|
|
32
|
+
|
|
33
|
+
// Batch (up to 10 URLs)
|
|
34
|
+
const jobs = await bz.analyzeBatch([
|
|
35
|
+
"https://example.com/a.mp3",
|
|
36
|
+
"https://example.com/b.mp3",
|
|
37
|
+
]);
|
|
38
|
+
console.log(jobs.length);
|
|
39
|
+
|
|
40
|
+
// Check usage
|
|
41
|
+
const usage = await bz.getUsage();
|
|
42
|
+
console.log(`${usage.count}/${usage.limit} analyses used`);
|
|
43
|
+
})().catch(console.error);
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
## TypeScript
|
|
@@ -47,6 +51,8 @@ Full type definitions included. Import types directly:
|
|
|
47
51
|
import { Beatlyze, AnalysisResult, BeatlyzeError } from "beatlyze";
|
|
48
52
|
```
|
|
49
53
|
|
|
54
|
+
The SDK targets the live production API at `https://api.beatlyze.dev` by default.
|
|
55
|
+
|
|
50
56
|
## License
|
|
51
57
|
|
|
52
58
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beatlyze",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "JavaScript/TypeScript SDK for the Beatlyze audio analysis API.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"homepage": "https://beatlyze.dev",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/mg0024/beatlyze
|
|
13
|
+
"url": "https://github.com/mg0024/beatlyze.git"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=18"
|