@audd/sdk 1.4.7 → 1.4.9

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 CHANGED
@@ -4,16 +4,9 @@
4
4
  [![Contract](https://github.com/AudDMusic/audd-node/actions/workflows/contract.yml/badge.svg)](https://github.com/AudDMusic/audd-node/actions/workflows/contract.yml)
5
5
  [![npm](https://img.shields.io/npm/v/@audd/sdk.svg)](https://www.npmjs.com/package/@audd/sdk)
6
6
 
7
- Official TypeScript / Node.js SDK for the [AudD](https://audd.io) music
8
- recognition API.
7
+ Official TypeScript / Node.js SDK for [AudD](https://audd.io) — music recognition from a short audio clip, a long audio file, or a live stream.
9
8
 
10
- AudD identifies music from a short audio clip, a URL, a long file, or a
11
- live stream. The HTTPS API is a plain form-POST — every endpoint is
12
- documented at **[docs.audd.io](https://docs.audd.io)** and you can call
13
- it from anywhere `fetch` works. This package adds typed result models
14
- with helpers for cover art, streaming-provider URLs, and previews;
15
- `AbortSignal`-aware async; ESM and CJS dual-build; and a separate
16
- browser-safe entry point for tokenless longpoll widgets.
9
+ The [API itself](https://docs.audd.io) is so simple that it can be easily used even without an SDK.
17
10
 
18
11
  ## Quickstart
19
12
 
@@ -21,12 +14,14 @@ browser-safe entry point for tokenless longpoll widgets.
21
14
  npm install @audd/sdk
22
15
  ```
23
16
 
17
+ Get your API token at [dashboard.audd.io](https://dashboard.audd.io).
18
+
24
19
  Recognize from a URL:
25
20
 
26
21
  ```ts
27
22
  import { AudD } from "@audd/sdk";
28
23
 
29
- const audd = new AudD("test"); // grab a real token at https://dashboard.audd.io
24
+ const audd = new AudD("test");
30
25
  const song = await audd.recognize("https://audd.tech/example.mp3");
31
26
  if (song) {
32
27
  console.log(`${song.artist} — ${song.title}`);
@@ -132,16 +127,18 @@ console.log(song.rawResponse); // the whole result object as the server returne
132
127
  flat array of matches:
133
128
 
134
129
  ```ts
135
- const matches = await audd.recognizeEnterprise("./show.mp3", {
136
- return: ["apple_music", "musicbrainz"],
137
- limit: 20,
138
- });
130
+ const matches = await audd.recognizeEnterprise("./show.mp3", { limit: 20 });
139
131
 
140
132
  for (const m of matches) {
141
- console.log(m.timecode, m.score, m.artist, m.title, m.isrc);
133
+ console.log(m.timecode, m.artist, m.title);
142
134
  }
143
135
  ```
144
136
 
137
+ `EnterpriseMatch` carries the same core tags plus `score`, `startOffset`,
138
+ `endOffset`, `isrc`, `upc`. Access to `isrc`, `upc`, and `score` requires
139
+ a Startup plan or higher — [contact us](mailto:api@audd.io) for enterprise
140
+ features.
141
+
145
142
  The default per-call timeout is **1 hour** for this endpoint (60s for
146
143
  standard recognition); override with `timeoutMs`.
147
144
 
package/dist/index.cjs CHANGED
@@ -355,6 +355,8 @@ var RECOGNITION_KEYS = [
355
355
  "release_date",
356
356
  "label",
357
357
  "song_link",
358
+ "isrc",
359
+ "upc",
358
360
  "apple_music",
359
361
  "spotify",
360
362
  "deezer",
@@ -381,6 +383,8 @@ function parseRecognitionResult(raw) {
381
383
  releaseDate: asString(r.release_date),
382
384
  label: asString(r.label),
383
385
  songLink,
386
+ isrc: asString(r.isrc),
387
+ upc: asString(r.upc),
384
388
  appleMusic: asObject(r.apple_music),
385
389
  spotify: asObject(r.spotify),
386
390
  deezer: asObject(r.deezer),