@dynamic-labs/client 4.9.0 → 4.9.1-preview.0
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/CHANGELOG.md +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/client/client.cjs +6 -3
- package/src/client/client.js +6 -3
- package/src/client/core/core.cjs +2 -1
- package/src/client/core/core.js +2 -1
- package/src/modules/instrumentationModule/index.d.ts +1 -0
- package/src/modules/instrumentationModule/instrumentationModule.cjs +34 -0
- package/src/modules/instrumentationModule/instrumentationModule.d.ts +6 -0
- package/src/modules/instrumentationModule/instrumentationModule.js +30 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.9.1-preview.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.0...v4.9.1-preview.0) (2025-03-07)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* 7702 on sepolia ([#8242](https://github.com/dynamic-labs/dynamic-auth/issues/8242)) ([8e1c63f](https://github.com/dynamic-labs/dynamic-auth/commit/8e1c63f240024f419e12787636dd2ebaacf8da94))
|
|
8
|
+
* embedded widget race condition that would show both embedded and non-embedded widgets at the same time ([8a52778](https://github.com/dynamic-labs/dynamic-auth/commit/8a5277888489e03871532331760c197aa6216495))
|
|
9
|
+
|
|
2
10
|
## [4.9.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.6...v4.9.0) (2025-03-07)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/client",
|
|
3
|
-
"version": "4.9.0",
|
|
3
|
+
"version": "4.9.1-preview.0",
|
|
4
4
|
"description": "Core package for utilizing Dynamic's sdk",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vue/reactivity": "^3.4.21",
|
|
22
|
-
"@dynamic-labs/assert-package-version": "4.9.0",
|
|
23
|
-
"@dynamic-labs/logger": "4.9.0",
|
|
24
|
-
"@dynamic-labs/message-transport": "4.9.0",
|
|
25
|
-
"@dynamic-labs/types": "4.9.0",
|
|
22
|
+
"@dynamic-labs/assert-package-version": "4.9.1-preview.0",
|
|
23
|
+
"@dynamic-labs/logger": "4.9.1-preview.0",
|
|
24
|
+
"@dynamic-labs/message-transport": "4.9.1-preview.0",
|
|
25
|
+
"@dynamic-labs/types": "4.9.1-preview.0",
|
|
26
26
|
"eventemitter3": "5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {}
|
package/src/client/client.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var logger = require('@dynamic-labs/logger');
|
|
7
6
|
var authModule = require('../modules/authModule/authModule.cjs');
|
|
7
|
+
var instrumentationModule = require('../modules/instrumentationModule/instrumentationModule.cjs');
|
|
8
8
|
var networksModule = require('../modules/networksModule/networksModule.cjs');
|
|
9
9
|
var sdkModule = require('../modules/sdkModule/sdkModule.cjs');
|
|
10
10
|
var userInterfaceModule = require('../modules/userInterfaceModule/userInterfaceModule.cjs');
|
|
@@ -22,11 +22,12 @@ const baseClientExtensionName = 'base';
|
|
|
22
22
|
* it will be used for.
|
|
23
23
|
*/
|
|
24
24
|
const createClient = (props) => {
|
|
25
|
-
|
|
25
|
+
const instrumentation = instrumentationModule.setupInstrumentationModule(props);
|
|
26
26
|
const core$1 = core.createCore(props);
|
|
27
|
+
instrumentation.trackCore(core$1);
|
|
27
28
|
setupFetchHandler.setupFetchHandler(core$1);
|
|
28
29
|
const baseExtendable = new Extendable.Extendable(core$1);
|
|
29
|
-
|
|
30
|
+
const client = baseExtendable.extend(() => {
|
|
30
31
|
core$1.declaredExtensionNames.push(baseClientExtensionName);
|
|
31
32
|
return {
|
|
32
33
|
/** Module that gives access over authentication state, such as the auth token and user */
|
|
@@ -41,6 +42,8 @@ const createClient = (props) => {
|
|
|
41
42
|
wallets: walletsModule.createWalletsModule(core$1),
|
|
42
43
|
};
|
|
43
44
|
});
|
|
45
|
+
instrumentation.trackClient(client);
|
|
46
|
+
return client;
|
|
44
47
|
};
|
|
45
48
|
|
|
46
49
|
exports.baseClientExtensionName = baseClientExtensionName;
|
package/src/client/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { Logger } from '@dynamic-labs/logger';
|
|
3
2
|
import { createAuthModule } from '../modules/authModule/authModule.js';
|
|
3
|
+
import { setupInstrumentationModule } from '../modules/instrumentationModule/instrumentationModule.js';
|
|
4
4
|
import { createNetworksModule } from '../modules/networksModule/networksModule.js';
|
|
5
5
|
import { createSdkModule } from '../modules/sdkModule/sdkModule.js';
|
|
6
6
|
import { createUserInterfaceModule } from '../modules/userInterfaceModule/userInterfaceModule.js';
|
|
@@ -18,11 +18,12 @@ const baseClientExtensionName = 'base';
|
|
|
18
18
|
* it will be used for.
|
|
19
19
|
*/
|
|
20
20
|
const createClient = (props) => {
|
|
21
|
-
|
|
21
|
+
const instrumentation = setupInstrumentationModule(props);
|
|
22
22
|
const core = createCore(props);
|
|
23
|
+
instrumentation.trackCore(core);
|
|
23
24
|
setupFetchHandler(core);
|
|
24
25
|
const baseExtendable = new Extendable(core);
|
|
25
|
-
|
|
26
|
+
const client = baseExtendable.extend(() => {
|
|
26
27
|
core.declaredExtensionNames.push(baseClientExtensionName);
|
|
27
28
|
return {
|
|
28
29
|
/** Module that gives access over authentication state, such as the auth token and user */
|
|
@@ -37,6 +38,8 @@ const createClient = (props) => {
|
|
|
37
38
|
wallets: createWalletsModule(core),
|
|
38
39
|
};
|
|
39
40
|
});
|
|
41
|
+
instrumentation.trackClient(client);
|
|
42
|
+
return client;
|
|
40
43
|
};
|
|
41
44
|
|
|
42
45
|
export { baseClientExtensionName, createClient };
|
package/src/client/core/core.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
+
var reactivity = require('@vue/reactivity');
|
|
6
7
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
7
8
|
var initializationModule = require('./modules/initializationModule/initializationModule.cjs');
|
|
8
9
|
var manifestModule = require('./modules/manifestModule/manifestModule.cjs');
|
|
@@ -29,7 +30,7 @@ const createCore = (props) => {
|
|
|
29
30
|
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
30
31
|
* checks this list and throws an error if it doesn't find "viem" there.
|
|
31
32
|
*/
|
|
32
|
-
declaredExtensionNames: [],
|
|
33
|
+
declaredExtensionNames: reactivity.reactive([]),
|
|
33
34
|
/**
|
|
34
35
|
* SDK initialization module handles the initialization error
|
|
35
36
|
*/
|
package/src/client/core/core.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { reactive } from '@vue/reactivity';
|
|
2
3
|
import { applyDefaultMessageOrigin, makeWaitForInitEvent, sdkHasLoadedEventName, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
3
4
|
import { createInitializationModule } from './modules/initializationModule/initializationModule.js';
|
|
4
5
|
import { createManifestModule } from './modules/manifestModule/manifestModule.js';
|
|
@@ -25,7 +26,7 @@ const createCore = (props) => {
|
|
|
25
26
|
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
26
27
|
* checks this list and throws an error if it doesn't find "viem" there.
|
|
27
28
|
*/
|
|
28
|
-
declaredExtensionNames: [],
|
|
29
|
+
declaredExtensionNames: reactive([]),
|
|
29
30
|
/**
|
|
30
31
|
* SDK initialization module handles the initialization error
|
|
31
32
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './instrumentationModule';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var reactivity = require('@vue/reactivity');
|
|
7
|
+
var logger = require('@dynamic-labs/logger');
|
|
8
|
+
|
|
9
|
+
const setupInstrumentationModule = (clientProps) => {
|
|
10
|
+
logger.Logger.setEnvironmentId(clientProps.environmentId);
|
|
11
|
+
logger.Logger.globalMetaData.set('platform-origin', 'host');
|
|
12
|
+
logger.Logger.globalMetaData.set('app-name', clientProps.appName);
|
|
13
|
+
return {
|
|
14
|
+
trackClient: (client) => {
|
|
15
|
+
client.sdk.on('loadedChanged', (loaded) => {
|
|
16
|
+
logger.Logger.globalMetaData.set('sdk-loaded', loaded);
|
|
17
|
+
});
|
|
18
|
+
client.auth.on('authenticatedUserChanged', (user) => {
|
|
19
|
+
logger.Logger.globalMetaData.set('user-id', user === null || user === void 0 ? void 0 : user.userId);
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
trackCore: (core) => {
|
|
23
|
+
reactivity.effect(() => {
|
|
24
|
+
logger.Logger.globalMetaData.set('declared-extension-names', core.declaredExtensionNames);
|
|
25
|
+
});
|
|
26
|
+
reactivity.effect(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
logger.Logger.globalMetaData.set('initialization-error', (_a = core.initialization.error) === null || _a === void 0 ? void 0 : _a.toString());
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.setupInstrumentationModule = setupInstrumentationModule;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { effect } from '@vue/reactivity';
|
|
3
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
4
|
+
|
|
5
|
+
const setupInstrumentationModule = (clientProps) => {
|
|
6
|
+
Logger.setEnvironmentId(clientProps.environmentId);
|
|
7
|
+
Logger.globalMetaData.set('platform-origin', 'host');
|
|
8
|
+
Logger.globalMetaData.set('app-name', clientProps.appName);
|
|
9
|
+
return {
|
|
10
|
+
trackClient: (client) => {
|
|
11
|
+
client.sdk.on('loadedChanged', (loaded) => {
|
|
12
|
+
Logger.globalMetaData.set('sdk-loaded', loaded);
|
|
13
|
+
});
|
|
14
|
+
client.auth.on('authenticatedUserChanged', (user) => {
|
|
15
|
+
Logger.globalMetaData.set('user-id', user === null || user === void 0 ? void 0 : user.userId);
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
trackCore: (core) => {
|
|
19
|
+
effect(() => {
|
|
20
|
+
Logger.globalMetaData.set('declared-extension-names', core.declaredExtensionNames);
|
|
21
|
+
});
|
|
22
|
+
effect(() => {
|
|
23
|
+
var _a;
|
|
24
|
+
Logger.globalMetaData.set('initialization-error', (_a = core.initialization.error) === null || _a === void 0 ? void 0 : _a.toString());
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { setupInstrumentationModule };
|