@kasflow/passkey-wallet 0.1.3 → 0.1.4

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
@@ -39,6 +39,43 @@ yarn add @kasflow/passkey-wallet
39
39
 
40
40
  That's it - all dependencies are bundled.
41
41
 
42
+ ## Configuration
43
+
44
+ ### WebAuthn Relying Party ID (rpId)
45
+
46
+ **CRITICAL:** The `rpId` determines which domains share the same passkey and wallet address.
47
+
48
+ **By default**, the SDK uses `kas-flow.xyz` as the rpId. You can customize this for your own domain:
49
+
50
+ ```bash
51
+ # In your .env or .env.local file
52
+ NEXT_PUBLIC_WEBAUTHN_RP_ID=yourdomain.com
53
+ ```
54
+
55
+ **Important Notes:**
56
+
57
+ 1. **Same Wallet Across Subdomains**: All `yourdomain.com` and `*.yourdomain.com` will share the same wallet address
58
+ 2. **Different rpId = Different Wallet**: Changing the rpId creates a completely different wallet!
59
+ 3. **Production Warning**: NEVER change rpId after users create wallets - they'll lose access!
60
+ 4. **Localhost Limitation**: `localhost` CANNOT use a production domain as rpId (WebAuthn security requirement)
61
+
62
+ **Example:**
63
+ ```env
64
+ # All these domains share the same wallet:
65
+ # - kas-flow.xyz
66
+ # - app.kas-flow.xyz
67
+ # - staging.kas-flow.xyz
68
+ NEXT_PUBLIC_WEBAUTHN_RP_ID=kas-flow.xyz
69
+ ```
70
+
71
+ **When to customize:**
72
+ - You're building your own app and want wallets tied to YOUR domain
73
+ - You need production and staging to share wallets (use parent domain)
74
+
75
+ **When NOT to customize:**
76
+ - You're integrating KasFlow into your app (use default)
77
+ - You're testing locally (use default, localhost wallets are separate)
78
+
42
79
  ## Quick Start
43
80
 
44
81
  ### Create a New Wallet
package/dist/index.js CHANGED
@@ -93,7 +93,7 @@ module.exports = __toCommonJS(index_exports);
93
93
 
94
94
  // src/constants.ts
95
95
  var WEBAUTHN_RP_NAME = "KasFlow";
96
- var WEBAUTHN_RP_ID = typeof window !== "undefined" ? window.location.hostname : "localhost";
96
+ var WEBAUTHN_RP_ID = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_WEBAUTHN_RP_ID || "kas-flow.xyz";
97
97
  var WEBAUTHN_TIMEOUT_MS = 6e4;
98
98
  var WEBAUTHN_PUB_KEY_CRED_PARAMS = [
99
99
  { alg: -7, type: "public-key" },
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/constants.ts
2
2
  var WEBAUTHN_RP_NAME = "KasFlow";
3
- var WEBAUTHN_RP_ID = typeof window !== "undefined" ? window.location.hostname : "localhost";
3
+ var WEBAUTHN_RP_ID = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_WEBAUTHN_RP_ID || "kas-flow.xyz";
4
4
  var WEBAUTHN_TIMEOUT_MS = 6e4;
5
5
  var WEBAUTHN_PUB_KEY_CRED_PARAMS = [
6
6
  { alg: -7, type: "public-key" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasflow/passkey-wallet",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Passkey-powered wallet SDK for Kaspa blockchain",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",