@bizkit.io/webclient 0.1.3 → 0.1.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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ type BizkitToken = {
|
|
|
7
7
|
url: string;
|
|
8
8
|
};
|
|
9
9
|
declare function bizkit_init(production: boolean): Promise<void>;
|
|
10
|
-
declare function get_bizkit_token(): Promise<BizkitToken
|
|
10
|
+
declare function get_bizkit_token(): Promise<BizkitToken>;
|
|
11
11
|
declare global {
|
|
12
12
|
function bizkit_init(production: boolean): Promise<void>;
|
|
13
|
-
function get_bizkit_token(): Promise<BizkitToken
|
|
13
|
+
function get_bizkit_token(): Promise<BizkitToken>;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
16
|
export { BizkitToken, bizkit_init, get_bizkit_token };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Copyright (c) 2026 bizkit.io
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
let e,t;async function n(n){return
|
|
4
|
+
let e,t;async function n(n){if(!t)return e=n?`https://w.bizkit.io`:`https://dw.bizkit.io`,new Promise((n,r)=>{function i(){n()}t=document.createElement(`iframe`),t.src=e,t.onload=i,t.referrerPolicy=`no-referrer`,document.body.appendChild(t)})}async function r(){return t?new Promise((n,r)=>{let i=setTimeout(r,2e3),a=new MessageChannel;a.port1.onmessage=t=>{if(i.close(),t.origin!==e)return r();n(t.data)},t.contentWindow?.postMessage(location.origin,e,[a.port2])}):Promise.reject(`not initialized!`)}window.bizkit_init=n,window.get_bizkit_token=r;export{n as bizkit_init,r as get_bizkit_token};
|