shogun-core 1.9.3 โ†’ 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Shogun Core ๐Ÿ“ฆ
2
2
 
3
- [![npm](https://img.shields.io/badge/npm-v1.7.0-blue)](https://www.npmjs.com/package/shogun-core)
3
+ [![npm](https://img.shields.io/badge/npm-v1.9.4-blue)](https://www.npmjs.com/package/shogun-core)
4
4
  [![License](https://img.shields.io/badge/license-MIT-yellow)](https://opensource.org/licenses/MIT)
5
5
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.3.3-blue)](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.7.5)
23
+ ## Recent Updates (v1.9.4)
24
24
 
25
- ### โœ… **Code Cleanup and Optimization**
25
+ ### โœ… **API Cleanup and Optimization**
26
26
 
27
- - **Removed Deprecated Functions**: Eliminated `handleSimpleOAuth` and Alby support
28
- - **Simplified API**: Removed redundant `updateUserAlias` (use `changeUsername` instead)
29
- - **Debug Functions Cleanup**: Removed debug-only functions like `clearAllStorageData`, `exportPair`
30
- - **Error Handler Optimization**: Removed debug statistics and debug helper functions
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", // For server-side flow
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 ShogunSDKConfig {
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
- "wallet:created": WalletEventData; // Wallet derived from user keys
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
- // Nota: in v1.7.0 l'evento `wallet:created` non รจ emesso dal core
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
- Nota: la derivazione automatica dei wallet e l'evento `wallet:created` sono sperimentali e non garantiti in v1.7.0.
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