saltfish 0.2.35 → 0.2.36
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/dist/core/services/PlayerInitializationService.d.ts.map +1 -1
- package/dist/core/services/UserManagementService.d.ts.map +1 -1
- package/dist/index.d.ts +24 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/player.js +2 -2
- package/dist/player.min.js +2 -2
- package/dist/saltfish-playlist-player.es.js +65 -44
- package/dist/saltfish-playlist-player.umd.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerInitializationService.d.ts","sourceRoot":"","sources":["../../../src/core/services/PlayerInitializationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"PlayerInitializationService.d.ts","sourceRoot":"","sources":["../../../src/core/services/PlayerInitializationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpE;;GAEG;AACH,qBAAa,2BAA4B,YAAW,4BAA4B;IAC9E,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,qBAAqB,CAAM;IACnC,OAAO,CAAC,oBAAoB,CAAM;IAGlC,OAAO,CAAC,UAAU,CAA+B;gBAErC,QAAQ,EAAE,eAAe;IAIrC;;OAEG;IACI,wBAAwB,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAInD;;OAEG;IACI,uBAAuB,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI;IAIvD;;OAEG;IACI,aAAa,IAAI,cAAc,GAAG,IAAI;IAI7C;;OAEG;IACU,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAoF9D;;OAEG;IACU,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmG7F;;OAEG;IACU,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgFrG;;OAEG;IACU,gCAAgC,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA+EnG;;OAEG;IACI,0BAA0B,IAAI,MAAM;IAqBpC,OAAO,IAAI,IAAI;CAGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserManagementService.d.ts","sourceRoot":"","sources":["../../../src/core/services/UserManagementService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserManagementService.d.ts","sourceRoot":"","sources":["../../../src/core/services/UserManagementService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKnF;;GAEG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,2BAA2B,CAAM;IAGzC,OAAO,CAAC,qBAAqB,CAA8B;IAC3D,OAAO,CAAC,qBAAqB,CAA6B;IAG1D,OAAO,CAAC,sBAAsB,CAAuE;gBAEzF,QAAQ,EAAE,eAAe;IAIrC;;OAEG;IACI,8BAA8B,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAIzD;;OAEG;IACI,yBAAyB,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,IAAI;IAIjG;;OAEG;IACI,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIvD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAyC7E;;OAEG;IACU,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCjF;;OAEG;IACU,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuDnE;;OAEG;IACI,qBAAqB,IAAI,IAAI;IAQ7B,OAAO,IAAI,IAAI;CAKvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,12 @@ export interface SaltfishAPI {
|
|
|
11
11
|
* @returns Promise that resolves when initialization is complete
|
|
12
12
|
* @note You don't need to use await with this method - it can be called synchronously.
|
|
13
13
|
* You can also listen for the 'initialized' event instead of awaiting the promise.
|
|
14
|
+
* @note Language configuration has been moved to identify() and identifyAnonymous() methods.
|
|
15
|
+
* The 'language' field in config is deprecated.
|
|
14
16
|
* @example
|
|
15
17
|
* // Using with just a token:
|
|
16
18
|
* saltfish.init('YOUR_API_TOKEN');
|
|
19
|
+
* saltfish.identify('user123', { language: 'sv' });
|
|
17
20
|
* saltfish.startPlaylist('your_playlist_id');
|
|
18
21
|
*
|
|
19
22
|
* // Using with configuration object:
|
|
@@ -32,7 +35,17 @@ export interface SaltfishAPI {
|
|
|
32
35
|
/**
|
|
33
36
|
* Identifies the current user
|
|
34
37
|
* @param userId - User ID
|
|
35
|
-
* @param userData - Additional user data
|
|
38
|
+
* @param userData - Additional user data (can include 'language' property: e.g., 'sv', 'en', 'de', or 'auto' for browser detection)
|
|
39
|
+
* @example
|
|
40
|
+
* // Identify user with language preference
|
|
41
|
+
* saltfish.identify('user123', {
|
|
42
|
+
* name: 'John Doe',
|
|
43
|
+
* email: 'john@example.com',
|
|
44
|
+
* language: 'sv' // Swedish playlists
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Use automatic language detection
|
|
48
|
+
* saltfish.identify('user123', { language: 'auto' });
|
|
36
49
|
*/
|
|
37
50
|
identify: (userId: string, userData?: Record<string, unknown>) => void;
|
|
38
51
|
/**
|
|
@@ -41,10 +54,17 @@ export interface SaltfishAPI {
|
|
|
41
54
|
* instead of communicating with the backend. It automatically generates and persists an anonymous
|
|
42
55
|
* user ID. It still supports triggered playlists functionality by using localStorage-based user data for
|
|
43
56
|
* playlist triggers and watched playlist tracking.
|
|
44
|
-
* @param userData - Optional additional user data
|
|
57
|
+
* @param userData - Optional additional user data (can include 'language' property: e.g., 'sv', 'en', 'de', or 'auto' for browser detection)
|
|
45
58
|
* @example
|
|
46
|
-
* // Identify user anonymously
|
|
47
|
-
* saltfish.identifyAnonymous({
|
|
59
|
+
* // Identify user anonymously with language preference
|
|
60
|
+
* saltfish.identifyAnonymous({
|
|
61
|
+
* name: 'John Doe',
|
|
62
|
+
* preferences: { theme: 'dark' },
|
|
63
|
+
* language: 'sv' // Swedish playlists
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* // Or with just language (auto-detect from browser)
|
|
67
|
+
* saltfish.identifyAnonymous({ language: 'auto' });
|
|
48
68
|
*
|
|
49
69
|
* // Or with no additional data
|
|
50
70
|
* saltfish.identifyAnonymous();
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC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