@unavatar/core 3.42.0 → 3.43.0

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
@@ -22,9 +22,9 @@
22
22
  - [Behance](#behance)
23
23
  - [Bluesky](#bluesky)
24
24
  - [Buy Me a Coffee](#buy-me-a-coffee)
25
- - [Cash App](#cash-app)
26
25
  - [CodePen](#codepen)
27
26
  - [Cults3D](#cults3d)
27
+ - [Cursor](#cursor)
28
28
  - [DeviantArt](#deviantart)
29
29
  - [Discord](#discord)
30
30
  - [Docker Hub](#docker-hub)
@@ -39,6 +39,7 @@
39
39
  - [Google](#google)
40
40
  - [Google Play](#google-play)
41
41
  - [Gravatar](#gravatar)
42
+ - [Hevy](#hevy)
42
43
  - [Hugging Face](#hugging-face)
43
44
  - [Instagram](#instagram)
44
45
  - [Ko-fi](#ko-fi)
@@ -50,29 +51,29 @@
50
51
  - [OnlyFans](#onlyfans)
51
52
  - [OpenStreetMap](#openstreetmap)
52
53
  - [Patreon](#patreon)
53
- - [PayPal](#paypal)
54
54
  - [Pinterest](#pinterest)
55
+ - [Primal](#primal)
55
56
  - [Printables](#printables)
56
57
  - [Product Hunt](#product-hunt)
57
58
  - [PSN Profiles](#psn-profiles)
59
+ - [Raycast](#raycast)
58
60
  - [Reddit](#reddit)
59
- - [Revolut](#revolut)
60
61
  - [Snapchat](#snapchat)
61
62
  - [SoundCloud](#soundcloud)
62
63
  - [Spotify](#spotify)
63
64
  - [Stack Overflow](#stack-overflow)
64
65
  - [Steam](#steam)
66
+ - [Strava](#strava)
65
67
  - [Substack](#substack)
66
68
  - [Telegram](#telegram)
67
69
  - [Thingiverse](#thingiverse)
68
70
  - [Threads](#threads)
71
+ - [TIDAL](#tidal)
69
72
  - [TikTok](#tiktok)
70
73
  - [Tumblr](#tumblr)
71
74
  - [Twitch](#twitch)
72
- - [Venmo](#venmo)
73
75
  - [Vimeo](#vimeo)
74
76
  - [WhatsApp](#whatsapp)
75
- - [Wise](#wise)
76
77
  - [X/Twitter](#xtwitter)
77
78
  - [Xbox Gamertag](#xbox-gamertag)
78
79
  - [YouTube](#youtube)
@@ -577,12 +578,6 @@ Get any Buy Me a Coffee creator's profile picture by their username.
577
578
 
578
579
  e.g., [unavatar.io/buymeacoffee/mikebarnesdrums](https://unavatar.io/buymeacoffee/mikebarnesdrums)
579
580
 
580
- ### Cash App
581
-
582
- Get any Cash App user's profile picture by their $cashtag.
583
-
584
- e.g., [unavatar.io/cashapp/ninja](https://unavatar.io/cashapp/ninja)
585
-
586
581
  ### CodePen
587
582
 
588
583
  Get any CodePen user's profile picture by their username.
@@ -595,6 +590,12 @@ Get any Cults3D creator's profile picture by username.
595
590
 
596
591
  e.g., [unavatar.io/cults3d/RaBros](https://unavatar.io/cults3d/RaBros)
597
592
 
593
+ ### Cursor
594
+
595
+ Get any Cursor user's profile picture by their username.
596
+
597
+ e.g., [unavatar.io/cursor/leerob](https://unavatar.io/cursor/leerob)
598
+
598
599
  ### DeviantArt
599
600
 
600
601
  Get any DeviantArt user's profile picture by their username.
@@ -730,6 +731,12 @@ When you pass an email address directly in the URL, it is visible in plain text
730
731
 
731
732
  To avoid this, pass a pre-computed `MD5` or `SHA256` hash of the email instead. Unavatar detects the hash automatically and routes it to Gravatar, which natively supports both hash formats.
732
733
 
734
+ ### Hevy
735
+
736
+ Get any Hevy user's profile picture by their username.
737
+
738
+ e.g., [unavatar.io/hevy/om_giigo](https://unavatar.io/hevy/om_giigo)
739
+
733
740
  ### Hugging Face
734
741
 
735
742
  Get profile pictures for Hugging Face users or organizations by their handle.
@@ -807,18 +814,18 @@ Get any Patreon creator's profile picture by their username.
807
814
 
808
815
  e.g., [unavatar.io/patreon/gametestro](https://unavatar.io/patreon/gametestro)
809
816
 
810
- ### PayPal
811
-
812
- Get any PayPal user's profile picture by their PayPal.Me username.
813
-
814
- e.g., [unavatar.io/paypal/kikobeats](https://unavatar.io/paypal/kikobeats)
815
-
816
817
  ### Pinterest
817
818
 
818
819
  Get any Pinterest user's profile picture by their username.
819
820
 
820
821
  e.g., [unavatar.io/pinterest/ohjoy](https://unavatar.io/pinterest/ohjoy)
821
822
 
823
+ ### Primal
824
+
825
+ Get any Primal user's profile picture by their username.
826
+
827
+ e.g., [unavatar.io/primal/jack](https://unavatar.io/primal/jack)
828
+
822
829
  ### Printables
823
830
 
824
831
  Get any Printables user's profile picture by their username.
@@ -844,6 +851,12 @@ Get any PlayStation Network user's profile picture by their PSN username.
844
851
 
845
852
  e.g., [unavatar.io/psnprofiles/Duff85](https://unavatar.io/psnprofiles/Duff85)
846
853
 
854
+ ### Raycast
855
+
856
+ Get any Raycast user's profile picture by their username.
857
+
858
+ e.g., [unavatar.io/raycast/peduarte](https://unavatar.io/raycast/peduarte)
859
+
847
860
  ### Reddit
848
861
 
849
862
  Get any Reddit user's avatar by their username.
@@ -853,12 +866,6 @@ Available inputs:
853
866
  - Username, e.g., [unavatar.io/reddit/thisisbillgates](https://unavatar.io/reddit/thisisbillgates)
854
867
  - Organization, e.g., [unavatar.io/reddit/nasa](https://unavatar.io/reddit/nasa)
855
868
 
856
- ### Revolut
857
-
858
- Get any Revolut user's profile picture by their Revolut.Me username.
859
-
860
- e.g., [unavatar.io/revolut/midudev](https://unavatar.io/revolut/midudev)
861
-
862
869
  ### Snapchat
863
870
 
864
871
  Get any Snapchat user's profile picture by their username.
@@ -909,6 +916,12 @@ Available inputs:
909
916
  - `profile`: [unavatar.io/steam/profile:76561198044605749](https://unavatar.io/steam/profile:76561198044605749)
910
917
  - `group`: [unavatar.io/steam/group:murcia-gaming](https://unavatar.io/steam/group:murcia-gaming)
911
918
 
919
+ ### Strava
920
+
921
+ Get any Strava athlete's profile picture by their username or athlete ID.
922
+
923
+ e.g., [unavatar.io/strava/kikobeats](https://unavatar.io/strava/kikobeats)
924
+
912
925
  ### Substack
913
926
 
914
927
  Get any Substack author's profile picture by their publication username.
@@ -933,6 +946,22 @@ Get any Threads user's profile picture by their username.
933
946
 
934
947
  e.g., [unavatar.io/threads/zuck](https://unavatar.io/threads/zuck)
935
948
 
949
+ ### TIDAL
950
+
951
+ Get artwork for any TIDAL entity — artists, albums, playlists, tracks, or videos. Look up by TIDAL ID.
952
+
953
+ By default the input is treated as an artist:
954
+
955
+ e.g., [unavatar.io/tidal/1566](https://unavatar.io/tidal/1566)
956
+
957
+ The input also supports a URI format `type:id`:
958
+
959
+ - `artist` (default): [unavatar.io/tidal/artist:1566](https://unavatar.io/tidal/artist:1566)
960
+ - `album`: [unavatar.io/tidal/album:1765857](https://unavatar.io/tidal/album:1765857)
961
+ - `playlist`: [unavatar.io/tidal/playlist:c3c18106-c4f5-4021-bb18-108255c1f450](https://unavatar.io/tidal/playlist:c3c18106-c4f5-4021-bb18-108255c1f450)
962
+ - `track`: [unavatar.io/tidal/track:113655761](https://unavatar.io/tidal/track:113655761)
963
+ - `video`: [unavatar.io/tidal/video:45323542](https://unavatar.io/tidal/video:45323542)
964
+
936
965
  ### TikTok
937
966
 
938
967
  Get any TikTok user's profile picture by their username. No authentication or API tokens needed — just pass the username.
@@ -951,12 +980,6 @@ Get any Twitch streamer's profile picture by their username.
951
980
 
952
981
  e.g., [unavatar.io/twitch/midudev](https://unavatar.io/twitch/midudev)
953
982
 
954
- ### Venmo
955
-
956
- Get any Venmo user's profile picture by their username.
957
-
958
- e.g., [unavatar.io/venmo/Jessica-Lee-77](https://unavatar.io/venmo/Jessica-Lee-77)
959
-
960
983
  ### Vimeo
961
984
 
962
985
  Get any Vimeo user's profile picture by their username.
@@ -977,12 +1000,6 @@ Available inputs:
977
1000
  - `channel`: [unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m](https://unavatar.io/whatsapp/channel:0029VaARuQ7KwqSXh9fiMc0m)
978
1001
  - `chat`: [unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz](https://unavatar.io/whatsapp/chat:D2FFycjQXrEIKG8qQjbwZz)
979
1002
 
980
- ### Wise
981
-
982
- Get any Wise user's profile picture by their Wisetag.
983
-
984
- e.g., [unavatar.io/wise/josev2264](https://unavatar.io/wise/josev2264)
985
-
986
1003
  ### X/Twitter
987
1004
 
988
1005
  Get any X (formerly Twitter) user's profile picture by their username.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@unavatar/core",
3
3
  "description": "Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.",
4
4
  "homepage": "https://unavatar.io",
5
- "version": "3.42.0",
5
+ "version": "3.43.0",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -51,6 +51,7 @@ const providersBy = {
51
51
  'telegram',
52
52
  'thingiverse',
53
53
  'threads',
54
+ 'tidal',
54
55
  'tiktok',
55
56
  'tumblr',
56
57
  'twitch',
@@ -118,6 +119,7 @@ module.exports = ctx => {
118
119
  telegram: require('./telegram')(ctx),
119
120
  thingiverse: require('./thingiverse')(ctx),
120
121
  threads: require('./threads')(ctx),
122
+ tidal: require('./tidal')(ctx),
121
123
  tiktok: require('./tiktok')(ctx),
122
124
  tumblr: require('./tumblr')(ctx),
123
125
  twitch: require('./twitch')(ctx),
@@ -0,0 +1,35 @@
1
+ 'use strict'
2
+
3
+ // Real artwork is served from resources.tidal.com. When an entity has no
4
+ // artwork the page keeps a generic share image (tidal.com/img/FB_…), so
5
+ // anything off the resources host is treated as a miss.
6
+ const isArtwork = url => /^https:\/\/resources\.tidal\.com\//.test(url)
7
+
8
+ const getAvatarUrl = input => {
9
+ const [first, second] = input.split(':')
10
+ const type = second ? first : 'artist'
11
+ const id = second ?? first
12
+ return `https://tidal.com/${type}/${id}`
13
+ }
14
+
15
+ // The static markup only ships the generic share image; the entity artwork is
16
+ // injected into og:image once the SPA hydrates, so the page must be prerendered.
17
+ const getAvatar = ({ $, getOgImage, NOT_FOUND }) => {
18
+ const image = getOgImage($)
19
+ return image && isArtwork(image) ? image : NOT_FOUND
20
+ }
21
+
22
+ const factory = ({ createHtmlProvider, getOgImage, NOT_FOUND }) =>
23
+ createHtmlProvider({
24
+ name: 'tidal',
25
+ url: getAvatarUrl,
26
+ getter: $ => getAvatar({ $, getOgImage, NOT_FOUND }),
27
+ htmlOpts: () => ({
28
+ prerender: true
29
+ })
30
+ })
31
+
32
+ factory.getAvatarUrl = getAvatarUrl
33
+ factory.getAvatar = getAvatar
34
+
35
+ module.exports = factory