@dynamic-labs/client 4.37.2 → 4.38.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 +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -6
- package/src/client/client.cjs +3 -0
- package/src/client/client.d.ts +5 -0
- package/src/client/client.js +3 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.cjs +2 -1
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.d.ts +1 -1
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.js +2 -1
- package/src/index.d.ts +4 -2
- package/src/modules/authModule/authModule.cjs +2 -0
- package/src/modules/authModule/authModule.d.ts +2 -0
- package/src/modules/authModule/authModule.js +2 -0
- package/src/modules/localeModule/index.d.ts +1 -0
- package/src/modules/localeModule/localeModule.cjs +15 -0
- package/src/modules/localeModule/localeModule.d.ts +14 -0
- package/src/modules/localeModule/localeModule.js +11 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.cjs +3 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.d.ts +17 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.38.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.37.2...v4.38.0) (2025-10-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add client.ui.updateUser.show method to update user with dynamic ui ([#9702](https://github.com/dynamic-labs/dynamic-auth/issues/9702)) ([9554e98](https://github.com/dynamic-labs/dynamic-auth/commit/9554e98eadf3f801a5ebe8b22493a87cc87b8178))
|
|
8
|
+
* add locale to react-native client ([#9698](https://github.com/dynamic-labs/dynamic-auth/issues/9698)) ([fe577fc](https://github.com/dynamic-labs/dynamic-auth/commit/fe577fccd3cc92e5153f66f401357035bb5baec3))
|
|
9
|
+
* add updateUser to react-native client ([#9701](https://github.com/dynamic-labs/dynamic-auth/issues/9701)) ([124fbf7](https://github.com/dynamic-labs/dynamic-auth/commit/124fbf7a350bfa6404e65def7b436686d38847ed))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* notes and trigger ([#9697](https://github.com/dynamic-labs/dynamic-auth/issues/9697)) ([5d24a77](https://github.com/dynamic-labs/dynamic-auth/commit/5d24a77faa8030434bc7dd0f35986984bc2576d5))
|
|
15
|
+
* **zerodev-extension:** allow zerodev kernel client to send user operation ([#9706](https://github.com/dynamic-labs/dynamic-auth/issues/9706)) ([b57afc9](https://github.com/dynamic-labs/dynamic-auth/commit/b57afc9f378d6b2423ca46faec5f6b2861d3cbf6))
|
|
16
|
+
|
|
2
17
|
### [4.37.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.37.1...v4.37.2) (2025-10-13)
|
|
3
18
|
|
|
4
19
|
|
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.
|
|
3
|
+
"version": "4.38.0",
|
|
4
4
|
"description": "Core package for utilizing Dynamic's sdk",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vue/reactivity": "^3.4.21",
|
|
22
22
|
"@dynamic-labs/sdk-api-core": "0.0.805",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
24
|
-
"@dynamic-labs/
|
|
25
|
-
"@dynamic-labs/
|
|
26
|
-
"@dynamic-labs/
|
|
27
|
-
"@dynamic-labs/
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.38.0",
|
|
24
|
+
"@dynamic-labs/locale": "4.38.0",
|
|
25
|
+
"@dynamic-labs/logger": "4.38.0",
|
|
26
|
+
"@dynamic-labs/message-transport": "4.38.0",
|
|
27
|
+
"@dynamic-labs/types": "4.38.0",
|
|
28
|
+
"@dynamic-labs/webview-messages": "4.38.0",
|
|
28
29
|
"eventemitter3": "5.0.1"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {}
|
package/src/client/client.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var logger = require('@dynamic-labs/logger');
|
|
|
7
7
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
8
8
|
var authModule = require('../modules/authModule/authModule.cjs');
|
|
9
9
|
var instrumentationModule = require('../modules/instrumentationModule/instrumentationModule.cjs');
|
|
10
|
+
var localeModule = require('../modules/localeModule/localeModule.cjs');
|
|
10
11
|
var mfaModule = require('../modules/mfaModule/mfaModule.cjs');
|
|
11
12
|
var networksModule = require('../modules/networksModule/networksModule.cjs');
|
|
12
13
|
var passkeysModule = require('../modules/passkeysModule/passkeysModule.cjs');
|
|
@@ -39,6 +40,8 @@ const createClient = (props) => {
|
|
|
39
40
|
return {
|
|
40
41
|
/** Module that gives access over authentication state, such as the auth token and user */
|
|
41
42
|
auth: authModule.createAuthModule(core$1),
|
|
43
|
+
/** Module that provides locale/translation features */
|
|
44
|
+
locale: localeModule.createLocaleModule(core$1),
|
|
42
45
|
/** Module that provides access to MFA features */
|
|
43
46
|
mfa: mfaModule.createMfaModule(core$1),
|
|
44
47
|
/** Module that provides all the networks configured */
|
package/src/client/client.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type ClientProps = {
|
|
|
12
12
|
evmNetworks?: EvmNetwork[];
|
|
13
13
|
debug?: ClientManifest['debug'];
|
|
14
14
|
globalWallets?: ClientManifest['globalWallets'];
|
|
15
|
+
locale?: ClientManifest['locale'];
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* Generates a basic client that allows interacting with Dynamic's SDK, which
|
|
@@ -23,6 +24,10 @@ export type ClientProps = {
|
|
|
23
24
|
export declare const createClient: (props: ClientProps) => {
|
|
24
25
|
/** Module that gives access over authentication state, such as the auth token and user */
|
|
25
26
|
auth: import("../modules/authModule").AuthModule;
|
|
27
|
+
/** Module that provides locale/translation features */
|
|
28
|
+
locale: {
|
|
29
|
+
changeLanguage: (lang: import("dist/packages/locale/src").Lang) => Promise<void>;
|
|
30
|
+
};
|
|
26
31
|
/** Module that provides access to MFA features */
|
|
27
32
|
mfa: import("../modules/mfaModule").MfaModule;
|
|
28
33
|
/** Module that provides all the networks configured */
|
package/src/client/client.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Logger } from '@dynamic-labs/logger';
|
|
|
3
3
|
import { setGlobalDebugEnabled } from '@dynamic-labs/message-transport';
|
|
4
4
|
import { createAuthModule } from '../modules/authModule/authModule.js';
|
|
5
5
|
import { setupInstrumentationModule } from '../modules/instrumentationModule/instrumentationModule.js';
|
|
6
|
+
import { createLocaleModule } from '../modules/localeModule/localeModule.js';
|
|
6
7
|
import { createMfaModule } from '../modules/mfaModule/mfaModule.js';
|
|
7
8
|
import { createNetworksModule } from '../modules/networksModule/networksModule.js';
|
|
8
9
|
import { createPasskeysModule } from '../modules/passkeysModule/passkeysModule.js';
|
|
@@ -35,6 +36,8 @@ const createClient = (props) => {
|
|
|
35
36
|
return {
|
|
36
37
|
/** Module that gives access over authentication state, such as the auth token and user */
|
|
37
38
|
auth: createAuthModule(core),
|
|
39
|
+
/** Module that provides locale/translation features */
|
|
40
|
+
locale: createLocaleModule(core),
|
|
38
41
|
/** Module that provides access to MFA features */
|
|
39
42
|
mfa: createMfaModule(core),
|
|
40
43
|
/** Module that provides all the networks configured */
|
package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _package = require('../../../../../../package.cjs');
|
|
7
7
|
|
|
8
|
-
const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, }) => ({
|
|
8
|
+
const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, locale, }) => ({
|
|
9
9
|
apiBaseUrl,
|
|
10
10
|
appLogoUrl,
|
|
11
11
|
appName,
|
|
@@ -15,6 +15,7 @@ const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName,
|
|
|
15
15
|
environmentId,
|
|
16
16
|
evmNetworks,
|
|
17
17
|
globalWallets,
|
|
18
|
+
locale,
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
exports.createPartialManifest = createPartialManifest;
|
package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ClientManifest } from '@dynamic-labs/webview-messages';
|
|
2
2
|
import { ClientProps } from '../../../../client';
|
|
3
|
-
export declare const createPartialManifest: ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, }: ClientProps) => Partial<ClientManifest>;
|
|
3
|
+
export declare const createPartialManifest: ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, locale, }: ClientProps) => Partial<ClientManifest>;
|
package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { version } from '../../../../../../package.js';
|
|
3
3
|
|
|
4
|
-
const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, }) => ({
|
|
4
|
+
const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, evmNetworks, debug, globalWallets, locale, }) => ({
|
|
5
5
|
apiBaseUrl,
|
|
6
6
|
appLogoUrl,
|
|
7
7
|
appName,
|
|
@@ -11,6 +11,7 @@ const createPartialManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName,
|
|
|
11
11
|
environmentId,
|
|
12
12
|
evmNetworks,
|
|
13
13
|
globalWallets,
|
|
14
|
+
locale,
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
export { createPartialManifest };
|
package/src/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export type { SocialProvider } from '@dynamic-labs/webview-messages';
|
|
1
|
+
export type { SocialProvider, UpdateUserReturnPayload, } from '@dynamic-labs/webview-messages';
|
|
2
2
|
export { type Core } from './client/core';
|
|
3
3
|
export type { Wallet } from './types';
|
|
4
4
|
export { Extendable, type Extension } from './utils/Extendable';
|
|
5
5
|
export { hasExtension } from './utils/Extendable/hasExtension';
|
|
6
6
|
export { createClient, type BaseClient, type ClientProps, baseClientExtensionName, } from './client';
|
|
7
7
|
export type { AuthModule } from './modules/authModule';
|
|
8
|
+
export type { LocaleModule } from './modules/localeModule';
|
|
9
|
+
export type { MfaModule } from './modules/mfaModule';
|
|
8
10
|
export type { SdkModule } from './modules/sdkModule';
|
|
9
11
|
export type { WalletsModule } from './modules/walletsModule';
|
|
10
|
-
export type {
|
|
12
|
+
export type { LocaleResource } from '@dynamic-labs/locale';
|
|
@@ -43,6 +43,8 @@ const createAuthModule = (core) => {
|
|
|
43
43
|
setHandler: (_, handler) => (handlers.userAuthenticated = handler),
|
|
44
44
|
sms: smsAuthModule.createSmsAuthModule(core),
|
|
45
45
|
social: socialAuthModule.createSocialAuthModule(core),
|
|
46
|
+
updateUser: (userFields) => requestChannel.request('updateUser', userFields),
|
|
47
|
+
verifyUserUpdateOtp: (verificationToken) => requestChannel.request('verifyUserUpdateOtp', verificationToken),
|
|
46
48
|
});
|
|
47
49
|
};
|
|
48
50
|
|
|
@@ -16,6 +16,8 @@ export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState>
|
|
|
16
16
|
external: ExternalAuthModule;
|
|
17
17
|
logout: AuthModuleMessages['logout'];
|
|
18
18
|
refreshUser: AuthModuleMessages['refreshUser'];
|
|
19
|
+
updateUser: AuthModuleMessages['updateUser'];
|
|
20
|
+
verifyUserUpdateOtp: AuthModuleMessages['verifyUserUpdateOtp'];
|
|
19
21
|
permanentlyDeleteCurrentUser: AuthModuleMessages['permanentlyDeleteCurrentUser'];
|
|
20
22
|
setHandler: (name: 'userAuthenticated', handler: AuthenticatedUserHandler) => void;
|
|
21
23
|
clearHandler: (name: 'userAuthenticated') => void;
|
|
@@ -39,6 +39,8 @@ const createAuthModule = (core) => {
|
|
|
39
39
|
setHandler: (_, handler) => (handlers.userAuthenticated = handler),
|
|
40
40
|
sms: createSmsAuthModule(core),
|
|
41
41
|
social: createSocialAuthModule(core),
|
|
42
|
+
updateUser: (userFields) => requestChannel.request('updateUser', userFields),
|
|
43
|
+
verifyUserUpdateOtp: (verificationToken) => requestChannel.request('verifyUserUpdateOtp', verificationToken),
|
|
42
44
|
});
|
|
43
45
|
};
|
|
44
46
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createLocaleModule, type LocaleModule } from './localeModule';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
7
|
+
|
|
8
|
+
const createLocaleModule = (core) => {
|
|
9
|
+
const localeRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
10
|
+
return {
|
|
11
|
+
changeLanguage: (lang) => localeRequestChannel.request('changeLanguage', lang),
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.createLocaleModule = createLocaleModule;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LocaleModuleMessages } from '@dynamic-labs/webview-messages';
|
|
2
|
+
import { Core } from '../../client/core';
|
|
3
|
+
type LocaleModuleMethods = {
|
|
4
|
+
/**
|
|
5
|
+
* Changes the current language of the SDK.
|
|
6
|
+
*
|
|
7
|
+
* Resolves when our SDK receives the request.
|
|
8
|
+
* Rejects if the request is not received.
|
|
9
|
+
*/
|
|
10
|
+
changeLanguage: LocaleModuleMessages['changeLanguage'];
|
|
11
|
+
};
|
|
12
|
+
export type LocaleModule = LocaleModuleMethods;
|
|
13
|
+
export declare const createLocaleModule: (core: Core) => LocaleModule;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
3
|
+
|
|
4
|
+
const createLocaleModule = (core) => {
|
|
5
|
+
const localeRequestChannel = createRequestChannel(core.messageTransport);
|
|
6
|
+
return {
|
|
7
|
+
changeLanguage: (lang) => localeRequestChannel.request('changeLanguage', lang),
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { createLocaleModule };
|
|
@@ -22,6 +22,9 @@ const createUserInterfaceModule = (core) => {
|
|
|
22
22
|
hide: () => userInterfaceRequestChannel.emit('hideFundingOptions'),
|
|
23
23
|
show: () => userInterfaceRequestChannel.emit('openFundingOptions'),
|
|
24
24
|
},
|
|
25
|
+
updateUser: {
|
|
26
|
+
show: (params) => userInterfaceRequestChannel.request('updateUserWithModal', params),
|
|
27
|
+
},
|
|
25
28
|
userProfile: {
|
|
26
29
|
hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
|
|
27
30
|
show: () => userInterfaceRequestChannel.emit('openUserProfile'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PickedEventListeners } from '@dynamic-labs/message-transport';
|
|
2
2
|
import { UserInterfaceModuleMessages, userInterfaceEventNames } from '@dynamic-labs/webview-messages';
|
|
3
|
+
import type { UserFields } from '@dynamic-labs/sdk-api-core';
|
|
3
4
|
import { Core } from '../../client/core';
|
|
4
5
|
type UserInterfaceModuleMethods = {
|
|
5
6
|
auth: {
|
|
@@ -53,6 +54,22 @@ type UserInterfaceModuleMethods = {
|
|
|
53
54
|
*/
|
|
54
55
|
hide: () => Promise<void>;
|
|
55
56
|
};
|
|
57
|
+
updateUser: {
|
|
58
|
+
/**
|
|
59
|
+
* Opens the user update modal with specified fields.
|
|
60
|
+
*
|
|
61
|
+
* Resolves with the updated user fields when the user completes the update.
|
|
62
|
+
* Rejects if the user cancels or if the request fails.
|
|
63
|
+
*/
|
|
64
|
+
show: (params: {
|
|
65
|
+
fields: (keyof UserFields)[];
|
|
66
|
+
options?: {
|
|
67
|
+
title?: string;
|
|
68
|
+
subtitle?: string;
|
|
69
|
+
submitText?: string;
|
|
70
|
+
};
|
|
71
|
+
}) => Promise<UserFields>;
|
|
72
|
+
};
|
|
56
73
|
};
|
|
57
74
|
type PublicUserInterfaceModuleMessages = Pick<UserInterfaceModuleMessages, typeof userInterfaceEventNames[number]>;
|
|
58
75
|
export type UserInterfaceModule = PickedEventListeners<PublicUserInterfaceModuleMessages> & UserInterfaceModuleMethods;
|
|
@@ -18,6 +18,9 @@ const createUserInterfaceModule = (core) => {
|
|
|
18
18
|
hide: () => userInterfaceRequestChannel.emit('hideFundingOptions'),
|
|
19
19
|
show: () => userInterfaceRequestChannel.emit('openFundingOptions'),
|
|
20
20
|
},
|
|
21
|
+
updateUser: {
|
|
22
|
+
show: (params) => userInterfaceRequestChannel.request('updateUserWithModal', params),
|
|
23
|
+
},
|
|
21
24
|
userProfile: {
|
|
22
25
|
hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
|
|
23
26
|
show: () => userInterfaceRequestChannel.emit('openUserProfile'),
|