@dynamic-labs/utils
Advanced tools
'use client' | ||
var version = "4.9.2-preview.0"; | ||
var version = "4.9.2"; | ||
export { version }; |
{ | ||
"name": "@dynamic-labs/utils", | ||
"version": "4.9.2-preview.0", | ||
"version": "4.9.2", | ||
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.", | ||
@@ -21,7 +21,7 @@ "author": "Dynamic Labs, Inc.", | ||
"dependencies": { | ||
"@dynamic-labs/sdk-api-core": "0.0.638", | ||
"@dynamic-labs/sdk-api-core": "0.0.640", | ||
"tldts": "6.0.16", | ||
"@dynamic-labs/assert-package-version": "4.9.2-preview.0", | ||
"@dynamic-labs/logger": "4.9.2-preview.0", | ||
"@dynamic-labs/types": "4.9.2-preview.0", | ||
"@dynamic-labs/assert-package-version": "4.9.2", | ||
"@dynamic-labs/logger": "4.9.2", | ||
"@dynamic-labs/types": "4.9.2", | ||
"buffer": "6.0.3", | ||
@@ -28,0 +28,0 @@ "eventemitter3": "5.0.1" |
@@ -7,2 +7,4 @@ 'use client' | ||
const setupInsideIframe = () => { | ||
if (typeof window === 'undefined') | ||
return; | ||
// Get the initial parent URL | ||
@@ -9,0 +11,0 @@ const initialParentURL = getInitialParentURL(); |
'use client' | ||
const missingParentURLMessage = `Parent URL is required | ||
You must pass the parent URL to the iframe using the following query parameter: | ||
?initial-parent-url=<encoded-parent-url> | ||
Example: | ||
const iframeUrl = new URL('https://my-iframe.com'); | ||
iframeUrl.searchParams.set('initial-parent-url', window.location.href); | ||
<iframe src="\${iframeUrl.toString()}"></iframe> | ||
For more information, see the documentation: | ||
https://npmjs.com/package/@dynamic-labs/iframe-setup | ||
`; | ||
const getInitialParentURL = () => { | ||
const initialParentURL = new URLSearchParams(window.location.search).get('initial-parent-url'); | ||
if (!initialParentURL) { | ||
throw new Error('Parent URL is required'); | ||
throw new Error(missingParentURLMessage); | ||
} | ||
@@ -7,0 +24,0 @@ return new URL(decodeURIComponent(initialParentURL)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
682946
0.34%6211
0.39%0
-100%19
11.76%41
5.13%27533
-5.22%