openDeeplink service on DynamicCore opens a URL in the right way for the current platform. Use it from an extension to send a user to a mobile wallet app, or to trigger a redirect that comes back to your app.
Access the service
openDeeplink is a function of type (url: string) => Promise<void>.
Platform behavior
- Web
- React Native
On web, the SDK uses
window.location.assign to navigate to the deep link in the same tab. This avoids extra about:blank tabs when the wallet redirects back to the app.Usage in an extension
Extensions can wrapopenDeeplink in a helper that builds the URL and then opens it:
Suppressing deeplinks during background operations
Some wallet requests exist only to move work forward and need no user interaction, such as polling the status of a transaction the user already approved. If your wallet integration opens a deeplink on every request, those background calls keep reopening the wallet app. The SDK exports two helpers from@dynamic-labs-sdk/client/core to coordinate this:
withDeeplinksSuppressed({ operation }, client)runs an async operation while deeplinks are suppressed. Suppression is counted, so overlapping operations do not re-enable deeplinks when the first one finishes, and deeplinks resume when the operation settles, whether it resolves or rejects.areDeeplinksSuppressed(client)returnstruewhile at least one suppressing operation is in flight. Call it before opening a deeplink that only brings the wallet app to the foreground.
QR codes on desktop and mobile web
The same URL passed toopenDeeplink can be encoded as a QR code on desktop or mobile web, where the user’s wallet app scans it instead of the page opening the link directly. Render the QR code with any QR library and use the same deep-link URL as the value.
Security notes
- Only open URLs from trusted sources.
- Reject schemes that can execute script, such as
javascript:ordata:. - If your extension accepts a
returnUrl, validate it against a known allow-list.