@worldcoin/minikit-js 1.0.0 → 1.0.1
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 +22 -2
- package/build/index.cjs +7 -1
- package/build/index.d.cts +2 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# Minikit-JS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 🚀 Getting Started
|
|
4
|
+
|
|
5
|
+
Minikit is currently available on npm. To install, run:
|
|
6
|
+
`pnpm i @worldcoin/minikit-js`
|
|
7
|
+
|
|
8
|
+
or use the CDN:
|
|
9
|
+
`https://cdn.jsdelivr.net/npm/@worldcoin/minikit-js@[version]/+esm`
|
|
10
|
+
|
|
11
|
+
For comprehensive setup instructions and usage examples, visit our [developer documentation](https://docs.world.org/mini-apps).
|
|
12
|
+
|
|
13
|
+
## 🛠 ️Developing Locally
|
|
14
|
+
|
|
15
|
+
To run the example mini app locally:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
pnpm i
|
|
19
|
+
cd demo/with-next
|
|
20
|
+
pnpm dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This will launch a demo mini app with all essential commands implemented, allowing you to explore and test the features.
|
package/build/index.cjs
CHANGED
|
@@ -494,7 +494,7 @@ var _MiniKit = class _MiniKit {
|
|
|
494
494
|
}
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
|
-
static install() {
|
|
497
|
+
static install(appId) {
|
|
498
498
|
if (typeof window === "undefined" || Boolean(window.MiniKit)) {
|
|
499
499
|
return {
|
|
500
500
|
success: false,
|
|
@@ -502,6 +502,11 @@ var _MiniKit = class _MiniKit {
|
|
|
502
502
|
errorMessage: MiniKitInstallErrorMessage["already_installed" /* AlreadyInstalled */]
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
|
+
if (!appId) {
|
|
506
|
+
console.warn("App ID not provided during install");
|
|
507
|
+
} else {
|
|
508
|
+
_MiniKit.appId = appId;
|
|
509
|
+
}
|
|
505
510
|
if (!window.WorldApp) {
|
|
506
511
|
return {
|
|
507
512
|
success: false,
|
|
@@ -573,6 +578,7 @@ _MiniKit.listeners = {
|
|
|
573
578
|
["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
|
|
574
579
|
}
|
|
575
580
|
};
|
|
581
|
+
_MiniKit.appId = null;
|
|
576
582
|
_MiniKit.walletAddress = null;
|
|
577
583
|
_MiniKit.commands = {
|
|
578
584
|
verify: (payload) => {
|
package/build/index.d.cts
CHANGED
|
@@ -322,13 +322,14 @@ declare class MiniKit {
|
|
|
322
322
|
private static readonly commandVersion;
|
|
323
323
|
private static isCommandAvailable;
|
|
324
324
|
private static listeners;
|
|
325
|
+
static appId: string | null;
|
|
325
326
|
static walletAddress: string | null;
|
|
326
327
|
private static sendInit;
|
|
327
328
|
static subscribe<E extends ResponseEvent>(event: E, handler: EventHandler<E>): void;
|
|
328
329
|
static unsubscribe(event: ResponseEvent): void;
|
|
329
330
|
static trigger(event: ResponseEvent, payload: EventPayload): void;
|
|
330
331
|
private static commandsValid;
|
|
331
|
-
static install(): MiniKitInstallReturnType;
|
|
332
|
+
static install(appId?: string): MiniKitInstallReturnType;
|
|
332
333
|
static isInstalled(debug?: boolean): boolean;
|
|
333
334
|
static commands: {
|
|
334
335
|
verify: (payload: VerifyCommandInput) => VerifyCommandPayload | null;
|
package/build/index.d.ts
CHANGED
|
@@ -322,13 +322,14 @@ declare class MiniKit {
|
|
|
322
322
|
private static readonly commandVersion;
|
|
323
323
|
private static isCommandAvailable;
|
|
324
324
|
private static listeners;
|
|
325
|
+
static appId: string | null;
|
|
325
326
|
static walletAddress: string | null;
|
|
326
327
|
private static sendInit;
|
|
327
328
|
static subscribe<E extends ResponseEvent>(event: E, handler: EventHandler<E>): void;
|
|
328
329
|
static unsubscribe(event: ResponseEvent): void;
|
|
329
330
|
static trigger(event: ResponseEvent, payload: EventPayload): void;
|
|
330
331
|
private static commandsValid;
|
|
331
|
-
static install(): MiniKitInstallReturnType;
|
|
332
|
+
static install(appId?: string): MiniKitInstallReturnType;
|
|
332
333
|
static isInstalled(debug?: boolean): boolean;
|
|
333
334
|
static commands: {
|
|
334
335
|
verify: (payload: VerifyCommandInput) => VerifyCommandPayload | null;
|
package/build/index.js
CHANGED
|
@@ -447,7 +447,7 @@ var _MiniKit = class _MiniKit {
|
|
|
447
447
|
}
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
|
-
static install() {
|
|
450
|
+
static install(appId) {
|
|
451
451
|
if (typeof window === "undefined" || Boolean(window.MiniKit)) {
|
|
452
452
|
return {
|
|
453
453
|
success: false,
|
|
@@ -455,6 +455,11 @@ var _MiniKit = class _MiniKit {
|
|
|
455
455
|
errorMessage: MiniKitInstallErrorMessage["already_installed" /* AlreadyInstalled */]
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
+
if (!appId) {
|
|
459
|
+
console.warn("App ID not provided during install");
|
|
460
|
+
} else {
|
|
461
|
+
_MiniKit.appId = appId;
|
|
462
|
+
}
|
|
458
463
|
if (!window.WorldApp) {
|
|
459
464
|
return {
|
|
460
465
|
success: false,
|
|
@@ -526,6 +531,7 @@ _MiniKit.listeners = {
|
|
|
526
531
|
["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
|
|
527
532
|
}
|
|
528
533
|
};
|
|
534
|
+
_MiniKit.appId = null;
|
|
529
535
|
_MiniKit.walletAddress = null;
|
|
530
536
|
_MiniKit.commands = {
|
|
531
537
|
verify: (payload) => {
|