shogun-button-react 1.5.28 → 1.5.30

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.
Files changed (2) hide show
  1. package/dist/connector.js +40 -4
  2. package/package.json +1 -1
package/dist/connector.js CHANGED
@@ -1,12 +1,48 @@
1
- import ShogunCore from "shogun-core";
1
+ import { ShogunCore } from "shogun-core";
2
2
  export function shogunConnector(options) {
3
- const { peers = ["https://gun-manhattan.herokuapp.com/gun"], appName, timeouts, oauth, ...restOptions } = options;
4
- const sdk = new ShogunCore({
3
+ const { peers = ["https://gun-manhattan.herokuapp.com/gun"], appName, timeouts, oauth, showMetamask, showWebauthn, showNostr, showOauth, ...restOptions } = options;
4
+ // Build ShogunCore configuration with authentication plugins
5
+ const shogunConfig = {
5
6
  peers,
6
7
  scope: appName,
7
8
  timeouts,
8
- oauth,
9
+ };
10
+ // Configure Web3/MetaMask plugin
11
+ if (showMetamask) {
12
+ shogunConfig.web3 = { enabled: true };
13
+ console.log("✅ Web3 plugin configured");
14
+ }
15
+ // Configure WebAuthn plugin
16
+ if (showWebauthn) {
17
+ shogunConfig.webauthn = {
18
+ enabled: true,
19
+ rpName: appName || "Shogun App",
20
+ rpId: typeof window !== "undefined" ? window.location.hostname : "localhost",
21
+ };
22
+ console.log("✅ WebAuthn plugin configured");
23
+ }
24
+ // Configure Nostr plugin
25
+ if (showNostr) {
26
+ shogunConfig.nostr = { enabled: true };
27
+ console.log("✅ Nostr plugin configured");
28
+ }
29
+ // Configure OAuth plugin
30
+ if (showOauth && oauth) {
31
+ shogunConfig.oauth = {
32
+ enabled: true,
33
+ usePKCE: true, // Mandatory for security
34
+ allowUnsafeClientSecret: true, // Required for Google OAuth
35
+ ...oauth,
36
+ };
37
+ console.log("✅ OAuth plugin configured");
38
+ }
39
+ console.log("🔧 Creating ShogunCore with config:", {
40
+ showMetamask,
41
+ showWebauthn,
42
+ showNostr,
43
+ showOauth,
9
44
  });
45
+ const sdk = new ShogunCore(shogunConfig);
10
46
  const registerPlugin = (plugin) => {
11
47
  if (sdk && typeof sdk.register === "function") {
12
48
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shogun-button-react",
3
3
  "description": "Shogun connector button",
4
- "version": "1.5.28",
4
+ "version": "1.5.30",
5
5
  "files": [
6
6
  "dist",
7
7
  "src/styles/index.css"