@dynamic-labs/utils 4.24.0 → 4.25.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/CHANGELOG.md +29 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/services/StorageService/StorageService.cjs +14 -0
- package/src/services/StorageService/StorageService.js +14 -0
- package/src/setupInsideIframe/setupInsideIframe.cjs +3 -1
- package/src/setupInsideIframe/setupInsideIframe.js +3 -1
- package/src/setupInsideIframe/utils/setupSocialService/index.d.ts +1 -0
- package/src/setupInsideIframe/utils/setupSocialService/setupSocialService.cjs +37 -0
- package/src/setupInsideIframe/utils/setupSocialService/setupSocialService.d.ts +1 -0
- package/src/setupInsideIframe/utils/setupSocialService/setupSocialService.js +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.25.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.25.0...v4.25.1) (2025-07-18)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add passkey sign in react hook ([#9188](https://github.com/dynamic-labs/dynamic-auth/issues/9188)) ([9d36886](https://github.com/dynamic-labs/dynamic-auth/commit/9d368860ca097777addf5e6f7e57c039cfbbb503))
|
|
8
|
+
* add support for social redirect with iframe-setup ([#9193](https://github.com/dynamic-labs/dynamic-auth/issues/9193)) ([fdfb321](https://github.com/dynamic-labs/dynamic-auth/commit/fdfb321220185d56d061342782754ad72e4b404e))
|
|
9
|
+
* update Argent wallet names to Ready branding ([#9142](https://github.com/dynamic-labs/dynamic-auth/issues/9142)) ([194e4cf](https://github.com/dynamic-labs/dynamic-auth/commit/194e4cf68ede58e2d38c6c720c01428b4e79cdf3))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* show hcaptcha for email and sms headless ([#9187](https://github.com/dynamic-labs/dynamic-auth/issues/9187)) ([9fa0860](https://github.com/dynamic-labs/dynamic-auth/commit/9fa086015196ff2c043d88e23f029964ddee92ab))
|
|
15
|
+
|
|
16
|
+
## [4.25.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.24.0...v4.25.0) (2025-07-17)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add passkey 1fa to react native ([#9167](https://github.com/dynamic-labs/dynamic-auth/issues/9167)) ([8f9b166](https://github.com/dynamic-labs/dynamic-auth/commit/8f9b166de3e0ab329c1539597c350681f1254bfb))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* add waas iframe retry ([#9185](https://github.com/dynamic-labs/dynamic-auth/issues/9185)) ([ebe40d5](https://github.com/dynamic-labs/dynamic-auth/commit/ebe40d5ecdf214362b013502b4ac1313ba356aeb))
|
|
27
|
+
* ensure storage service defaults to local storage ([#9182](https://github.com/dynamic-labs/dynamic-auth/issues/9182)) ([d6ce48e](https://github.com/dynamic-labs/dynamic-auth/commit/d6ce48e8c1d2edb32d8db41efe3f56b97275c32a))
|
|
28
|
+
* add account address to wallet properties ([#9172](https://github.com/dynamic-labs/dynamic-auth/issues/9172)) ([61de8ca](https://github.com/dynamic-labs/dynamic-auth/commit/61de8caccb95c5d52126283ac7a1ebd5a36aa33c))
|
|
29
|
+
* show hcaptcha for headless social sign in ([#9154](https://github.com/dynamic-labs/dynamic-auth/issues/9154)) ([262b752](https://github.com/dynamic-labs/dynamic-auth/commit/262b75257ec6dcc05f67804b71f7285ec5919f91))
|
|
30
|
+
|
|
2
31
|
## [4.24.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.23.1...v4.24.0) (2025-07-15)
|
|
3
32
|
|
|
4
33
|
### Features
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.1",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.718",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
24
|
-
"@dynamic-labs/logger": "4.
|
|
25
|
-
"@dynamic-labs/types": "4.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.25.1",
|
|
24
|
+
"@dynamic-labs/logger": "4.25.1",
|
|
25
|
+
"@dynamic-labs/types": "4.25.1",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var EventEmitter = require('eventemitter3');
|
|
7
|
+
var logger = require('../../logger/logger.cjs');
|
|
8
|
+
var createStorageService = require('./createStorageService/createStorageService.cjs');
|
|
7
9
|
|
|
8
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
11
|
|
|
@@ -31,6 +33,18 @@ class StorageService {
|
|
|
31
33
|
return storage;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Temporary fallback until we ensure that one instance of the utils package is
|
|
38
|
+
* installed
|
|
39
|
+
*
|
|
40
|
+
* thread https://dynamiclabsgroup.slack.com/archives/C03HMTUCXRR/p1752662470299459
|
|
41
|
+
*/
|
|
42
|
+
if (priority.includes('localStorage')) {
|
|
43
|
+
logger.logger.info('No available storage found based on the specified priority, default to localStorage');
|
|
44
|
+
return createStorageService.createStorageService({
|
|
45
|
+
storage: localStorage,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
34
48
|
throw new Error('No available storage found based on the specified priority');
|
|
35
49
|
}
|
|
36
50
|
static getItem(key, options) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import EventEmitter from 'eventemitter3';
|
|
3
|
+
import { logger } from '../../logger/logger.js';
|
|
4
|
+
import { createStorageService } from './createStorageService/createStorageService.js';
|
|
3
5
|
|
|
4
6
|
class StorageService {
|
|
5
7
|
static clearRegistry() {
|
|
@@ -23,6 +25,18 @@ class StorageService {
|
|
|
23
25
|
return storage;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Temporary fallback until we ensure that one instance of the utils package is
|
|
30
|
+
* installed
|
|
31
|
+
*
|
|
32
|
+
* thread https://dynamiclabsgroup.slack.com/archives/C03HMTUCXRR/p1752662470299459
|
|
33
|
+
*/
|
|
34
|
+
if (priority.includes('localStorage')) {
|
|
35
|
+
logger.info('No available storage found based on the specified priority, default to localStorage');
|
|
36
|
+
return createStorageService({
|
|
37
|
+
storage: localStorage,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
26
40
|
throw new Error('No available storage found based on the specified priority');
|
|
27
41
|
}
|
|
28
42
|
static getItem(key, options) {
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var setupPlatformService = require('./utils/setupPlatformService/setupPlatformService.cjs');
|
|
7
6
|
var getInitialParentURL = require('./utils/getInitialParentURL/getInitialParentURL.cjs');
|
|
8
7
|
var setupPlatformEventsService = require('./utils/setupPlatformEventsService/setupPlatformEventsService.cjs');
|
|
8
|
+
var setupPlatformService = require('./utils/setupPlatformService/setupPlatformService.cjs');
|
|
9
|
+
var setupSocialService = require('./utils/setupSocialService/setupSocialService.cjs');
|
|
9
10
|
|
|
10
11
|
const setupInsideIframe = () => {
|
|
11
12
|
if (typeof window === 'undefined')
|
|
@@ -15,6 +16,7 @@ const setupInsideIframe = () => {
|
|
|
15
16
|
// Setup services
|
|
16
17
|
setupPlatformService.setupPlatformService(initialParentURL);
|
|
17
18
|
setupPlatformEventsService.setupPlatformEventsService(initialParentURL);
|
|
19
|
+
setupSocialService.setupSocialService();
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
exports.setupInsideIframe = setupInsideIframe;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { setupPlatformService } from './utils/setupPlatformService/setupPlatformService.js';
|
|
3
2
|
import { getInitialParentURL } from './utils/getInitialParentURL/getInitialParentURL.js';
|
|
4
3
|
import { setupPlatformEventsService } from './utils/setupPlatformEventsService/setupPlatformEventsService.js';
|
|
4
|
+
import { setupPlatformService } from './utils/setupPlatformService/setupPlatformService.js';
|
|
5
|
+
import { setupSocialService } from './utils/setupSocialService/setupSocialService.js';
|
|
5
6
|
|
|
6
7
|
const setupInsideIframe = () => {
|
|
7
8
|
if (typeof window === 'undefined')
|
|
@@ -11,6 +12,7 @@ const setupInsideIframe = () => {
|
|
|
11
12
|
// Setup services
|
|
12
13
|
setupPlatformService(initialParentURL);
|
|
13
14
|
setupPlatformEventsService(initialParentURL);
|
|
15
|
+
setupSocialService();
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export { setupInsideIframe };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupSocialService } from './setupSocialService';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var Oauth2Service = require('../../../services/Oauth2Service/Oauth2Service.cjs');
|
|
9
|
+
require('@dynamic-labs/types');
|
|
10
|
+
require('../../../logger/logger.cjs');
|
|
11
|
+
var PlatformService = require('../../../services/PlatformService/PlatformService.cjs');
|
|
12
|
+
require('tldts');
|
|
13
|
+
|
|
14
|
+
const setupSocialService = () => {
|
|
15
|
+
Oauth2Service.Oauth2Service.implementation = {
|
|
16
|
+
getOauthCode: (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ setIsProcessing, strategy, provider, oauthLoginUrl, initWebAuth, redirectUrl, }) {
|
|
17
|
+
return new Promise((_, reject) => {
|
|
18
|
+
setIsProcessing(true);
|
|
19
|
+
/**
|
|
20
|
+
* Use redirect flow on mobile for all providers except Telegram
|
|
21
|
+
*/
|
|
22
|
+
if (strategy === 'redirect' && provider !== sdkApiCore.ProviderEnum.Telegram) {
|
|
23
|
+
if (!redirectUrl) {
|
|
24
|
+
throw new Error('Redirect URL is required');
|
|
25
|
+
}
|
|
26
|
+
initWebAuth({
|
|
27
|
+
redirectUrl,
|
|
28
|
+
}).then(() => PlatformService.PlatformService.openURL(oauthLoginUrl.toString()));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
reject(new Error('Unsupported social provider'));
|
|
32
|
+
});
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.setupSocialService = setupSocialService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setupSocialService: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { Oauth2Service } from '../../../services/Oauth2Service/Oauth2Service.js';
|
|
5
|
+
import '@dynamic-labs/types';
|
|
6
|
+
import '../../../logger/logger.js';
|
|
7
|
+
import { PlatformService } from '../../../services/PlatformService/PlatformService.js';
|
|
8
|
+
import 'tldts';
|
|
9
|
+
|
|
10
|
+
const setupSocialService = () => {
|
|
11
|
+
Oauth2Service.implementation = {
|
|
12
|
+
getOauthCode: (_a) => __awaiter(void 0, [_a], void 0, function* ({ setIsProcessing, strategy, provider, oauthLoginUrl, initWebAuth, redirectUrl, }) {
|
|
13
|
+
return new Promise((_, reject) => {
|
|
14
|
+
setIsProcessing(true);
|
|
15
|
+
/**
|
|
16
|
+
* Use redirect flow on mobile for all providers except Telegram
|
|
17
|
+
*/
|
|
18
|
+
if (strategy === 'redirect' && provider !== ProviderEnum.Telegram) {
|
|
19
|
+
if (!redirectUrl) {
|
|
20
|
+
throw new Error('Redirect URL is required');
|
|
21
|
+
}
|
|
22
|
+
initWebAuth({
|
|
23
|
+
redirectUrl,
|
|
24
|
+
}).then(() => PlatformService.openURL(oauthLoginUrl.toString()));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
reject(new Error('Unsupported social provider'));
|
|
28
|
+
});
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { setupSocialService };
|