shogun-core 1.9.4 โ 1.9.5
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 +18 -14
- package/dist/browser/shogun-core.js +2190 -1206
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/src/gundb/gun-Instance.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Shogun Core ๐ฆ
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/shogun-core)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
@@ -20,16 +20,14 @@ Shogun Core is a comprehensive SDK for building decentralized applications (dApp
|
|
|
20
20
|
- ๐ **Cryptographic Wallets**: Automatic derivation of Bitcoin and Ethereum wallets from user keys
|
|
21
21
|
- โ
**Type Consistency**: Unified return types across all authentication methods
|
|
22
22
|
|
|
23
|
-
## Recent Updates (v1.
|
|
23
|
+
## Recent Updates (v1.9.4)
|
|
24
24
|
|
|
25
|
-
### โ
**
|
|
25
|
+
### โ
**API Cleanup and Optimization**
|
|
26
26
|
|
|
27
|
-
- **Removed Deprecated Functions**: Eliminated `
|
|
28
|
-
- **Simplified API**:
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **Cache Management**: Removed optional cache functions for cleaner API
|
|
32
|
-
- **Bundle Size Reduction**: Estimated 15-20% reduction in bundle size
|
|
27
|
+
- **Removed Deprecated Functions**: Eliminated `updateUserAlias` (use `changeUsername` instead), `handleSimpleOAuth`, `clearAllStorageData`, `exportPair`
|
|
28
|
+
- **Simplified API**: Streamlined core methods for better maintainability
|
|
29
|
+
- **Enhanced Type Safety**: Improved TypeScript definitions and error handling
|
|
30
|
+
- **Performance Improvements**: Optimized plugin system and event handling
|
|
33
31
|
|
|
34
32
|
## Recent Updates (v1.7.0)
|
|
35
33
|
|
|
@@ -89,10 +87,11 @@ const shogun = new ShogunCore({
|
|
|
89
87
|
oauth: {
|
|
90
88
|
enabled: true,
|
|
91
89
|
usePKCE: true, // Recommended for SPAs
|
|
90
|
+
allowUnsafeClientSecret: true, // Required for Google OAuth
|
|
92
91
|
providers: {
|
|
93
92
|
google: {
|
|
94
93
|
clientId: "YOUR_GOOGLE_CLIENT_ID",
|
|
95
|
-
clientSecret: "YOUR_GOOGLE_CLIENT_SECRET", //
|
|
94
|
+
clientSecret: "YOUR_GOOGLE_CLIENT_SECRET", // Required for Google even with PKCE
|
|
96
95
|
redirectUri: "http://localhost:3000/auth/callback",
|
|
97
96
|
scope: ["openid", "email", "profile"],
|
|
98
97
|
},
|
|
@@ -498,7 +497,7 @@ You can also use Shogun Core directly in the browser by including it from a CDN.
|
|
|
498
497
|
### Configuration Options
|
|
499
498
|
|
|
500
499
|
```typescript
|
|
501
|
-
interface
|
|
500
|
+
interface ShogunCoreConfig {
|
|
502
501
|
peers?: string[]; // GunDB peer URLs
|
|
503
502
|
scope?: string; // Application scope
|
|
504
503
|
authToken?: string; // GunDB super peer secret
|
|
@@ -522,6 +521,7 @@ interface ShogunSDKConfig {
|
|
|
522
521
|
oauth?: {
|
|
523
522
|
enabled?: boolean;
|
|
524
523
|
usePKCE?: boolean;
|
|
524
|
+
allowUnsafeClientSecret?: boolean;
|
|
525
525
|
providers?: Record<string, any>;
|
|
526
526
|
};
|
|
527
527
|
|
|
@@ -544,7 +544,11 @@ interface ShogunEventMap {
|
|
|
544
544
|
"auth:login": AuthEventData; // User logged in
|
|
545
545
|
"auth:logout": void; // User logged out
|
|
546
546
|
"auth:signup": AuthEventData; // New user registered
|
|
547
|
-
"
|
|
547
|
+
"auth:username_changed": {
|
|
548
|
+
oldUsername?: string;
|
|
549
|
+
newUsername?: string;
|
|
550
|
+
userPub?: string;
|
|
551
|
+
}; // Username changed
|
|
548
552
|
"gun:put": GunDataEventData; // Data written to GunDB
|
|
549
553
|
"gun:get": GunDataEventData; // Data read from GunDB
|
|
550
554
|
"gun:set": GunDataEventData; // Data updated in GunDB
|
|
@@ -576,7 +580,7 @@ shogun.on("auth:signup", (data) => {
|
|
|
576
580
|
console.log("New user signed up:", data.username);
|
|
577
581
|
});
|
|
578
582
|
|
|
579
|
-
//
|
|
583
|
+
// Note: The `wallet:created` event is defined in types but not currently emitted by the core
|
|
580
584
|
|
|
581
585
|
// Listen for errors
|
|
582
586
|
shogun.on("error", (error) => {
|
|
@@ -586,7 +590,7 @@ shogun.on("error", (error) => {
|
|
|
586
590
|
|
|
587
591
|
## Cryptographic Wallets
|
|
588
592
|
|
|
589
|
-
|
|
593
|
+
Note: Automatic wallet derivation and the `wallet:created` event are experimental and not guaranteed in the current version.
|
|
590
594
|
|
|
591
595
|
## Error Handling
|
|
592
596
|
|