socialfi-widget 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +62 -2
- package/index.cjs +2 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +92 -4
- package/react.cjs +3 -0
- package/react.d.ts +1 -0
- package/react.js +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CabalSpy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# socialfi-widget — drop-in SocialFi widgets for any site
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/socialfi-widget) [](https://github.com/CabalSpy/socialfi-widget/actions/workflows/ci.yml) [](LICENSE)
|
|
4
|
+
|
|
5
|
+
**socialfi-widget** puts the CabalSpy ID SocialFi widgets on any website or React app: the "Sign in with CabalSpy ID" button (login with X + verified wallets, KOL badge, avatar menu) and the token theses widget (holders' theses with their real position and live PnL, replies, reactions). Designs come from your dashboard and can be overridden per widget.
|
|
6
|
+
|
|
7
|
+
Part of **[CabalSpy ID](https://id.cabalspy.xyz)** — the SocialFi layer for crypto apps. [Website](https://www.cabalspy.xyz/cabalspy-id/) · [Docs](https://docs.cabalspy.xyz/cabalspy-id) · [API dashboard](https://apidashboard.cabalspy.xyz) · [Full SDK: cabalspy-id](https://github.com/CabalSpy/cabalspy-id-js)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install socialfi-widget
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Any website**
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { mountLoginButton, mountTheses } from 'socialfi-widget';
|
|
17
|
+
|
|
18
|
+
mountLoginButton('#login', {
|
|
19
|
+
clientId: 'csid_...',
|
|
20
|
+
shape: 'pill',
|
|
21
|
+
scope: ['openid', 'profile', 'thesis'],
|
|
22
|
+
onLogin: ({ idToken }) => fetch('/api/session', { method: 'POST', body: JSON.stringify({ idToken }) }),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const theses = mountTheses('#theses', { chain: 'solana', mint, clientId: 'csid_...', theme: 'dark', compact: true });
|
|
26
|
+
theses.update({ theme: 'light' });
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**React**
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { CabalSpyLogin, CabalSpyTheses, useCabalSpyID } from 'socialfi-widget/react';
|
|
33
|
+
|
|
34
|
+
<CabalSpyLogin clientId="csid_..." onLogin={({ idToken }) => sendToBackend(idToken)} />
|
|
35
|
+
<CabalSpyTheses chain="solana" mint={mint} clientId="csid_..." accent="#3ddc84" showSentiment />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
No bundler? Use the script tag directly: `<div data-csid-login data-client-id="csid_..."></div><script src="https://id.cabalspy.xyz/widget.js" async></script>`.
|
|
39
|
+
|
|
40
|
+
Options: login button — `clientId`, `theme`, `color`, `textColor`, `shape`, `size`, `label`, `fullWidth`, `showLogo`, `href`, `redirectUri`, `scope`, `user`, `logoutHref`; theses widget — `chain`, `mint`, `clientId`, `theme`, `scope`, `sort`, `font`, `radius`, `bg`, `card`, `text`, `muted`, `border`, `accent`, `accentText`, `bull`, `bear`, `showHeader`, `showSentiment`, `compact`, `height`, `accessToken`.
|
|
41
|
+
|
|
42
|
+
Always verify the `idToken` on your backend (e.g. with [socialfi-api](https://github.com/CabalSpy/socialfi-api): `CabalSpyIDAuth.verifyIdToken`).
|
|
43
|
+
|
|
44
|
+
Contents: the `cabalspy-id/widget` entry point and `cabalspy-id/widget/react`.
|
|
45
|
+
|
|
46
|
+
## Packages
|
|
47
|
+
|
|
48
|
+
| Package | npm | PyPI |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| [cabalspy-id](https://github.com/CabalSpy/cabalspy-id-js) (everything) | `cabalspy-id` | `cabalspy-id` |
|
|
51
|
+
| [socialfi-api](https://github.com/CabalSpy/socialfi-api) | `socialfi-api` | `socialfi-api` |
|
|
52
|
+
| [socialfi-thesis](https://github.com/CabalSpy/socialfi-thesis) | `socialfi-thesis` | `socialfi-thesis` |
|
|
53
|
+
| [socialfi-widget](https://github.com/CabalSpy/socialfi-widget) | `socialfi-widget` | – |
|
|
54
|
+
|
|
55
|
+
Versions follow `cabalspy-id`: 0.5.0 depends on `cabalspy-id` 0.5.0. This package contains no code of its own — it re-exports part of `cabalspy-id`, so behaviour, fixes and types are always the same.
|
|
56
|
+
|
|
57
|
+
## Releasing
|
|
58
|
+
|
|
59
|
+
Publish a GitHub release (any tag, e.g. `v0.5.0`) after the matching `cabalspy-id` version is on npm; the publish workflow uses npm trusted publishing.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/index.cjs
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'cabalspy-id/widget';
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "socialfi-widget",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "SocialFi widget — drop-in \"Sign in with CabalSpy ID\" button and token theses widget for any website or React app: login with X + verified wallets, KOL badges, holders' theses with live PnL. By CabalSpy ID.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"socialfi-widget",
|
|
7
|
+
"socialfi-api",
|
|
8
|
+
"login-button",
|
|
9
|
+
"token-thesis",
|
|
10
|
+
"socialfi",
|
|
11
|
+
"social-trading",
|
|
12
|
+
"copy-trading",
|
|
13
|
+
"crypto-social",
|
|
14
|
+
"web3-social",
|
|
15
|
+
"kol",
|
|
16
|
+
"kol-tracker",
|
|
17
|
+
"wallet-tracker",
|
|
18
|
+
"trading-leaderboard",
|
|
19
|
+
"pnl",
|
|
20
|
+
"crypto-login",
|
|
21
|
+
"solana",
|
|
22
|
+
"bnb",
|
|
23
|
+
"base",
|
|
24
|
+
"ethereum",
|
|
25
|
+
"cabalspy",
|
|
26
|
+
"cabalspy-id",
|
|
27
|
+
"react",
|
|
28
|
+
"widget"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"homepage": "https://www.cabalspy.xyz/cabalspy-id/",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/CabalSpy/socialfi-widget.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/CabalSpy/socialfi-widget/issues"
|
|
38
|
+
},
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "./index.cjs",
|
|
41
|
+
"module": "./index.js",
|
|
42
|
+
"types": "./index.d.ts",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
|
+
"import": "./index.js",
|
|
47
|
+
"require": "./index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./react": {
|
|
50
|
+
"types": "./react.d.ts",
|
|
51
|
+
"import": "./react.js",
|
|
52
|
+
"require": "./react.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./package.json": "./package.json"
|
|
55
|
+
},
|
|
56
|
+
"typesVersions": {
|
|
57
|
+
"*": {
|
|
58
|
+
"react": [
|
|
59
|
+
"./react.d.ts"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"LICENSE",
|
|
65
|
+
"README.md",
|
|
66
|
+
"index.cjs",
|
|
67
|
+
"index.d.ts",
|
|
68
|
+
"index.js",
|
|
69
|
+
"react.cjs",
|
|
70
|
+
"react.d.ts",
|
|
71
|
+
"react.js"
|
|
72
|
+
],
|
|
73
|
+
"sideEffects": false,
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=18"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"test": "node --test test/exports.test.mjs"
|
|
79
|
+
},
|
|
80
|
+
"dependencies": {
|
|
81
|
+
"cabalspy-id": "^0.5.0"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"react": ">=18"
|
|
85
|
+
},
|
|
86
|
+
"peerDependenciesMeta": {
|
|
87
|
+
"react": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"publishConfig": {
|
|
92
|
+
"access": "public"
|
|
93
|
+
}
|
|
94
|
+
}
|
package/react.cjs
ADDED
package/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'cabalspy-id/widget/react';
|
package/react.js
ADDED