DynamicClient. Use it to integrate a wallet that Dynamic does not officially support, or to add new features that the Dynamic team has not implemented. Once published to npm, other developers can import and call the extension to add that functionality to their own Dynamic client.
Extension skeleton
Every extension follows the same pattern: check whether it is already registered withhasExtension, call registerExtension, then add the providers or services the extension contributes.
extensionKeyis a unique string for your extension.hasExtensionmakes the call idempotent so multiple imports do not double-register.clientdefaults togetDefaultClient(). Only pass a client explicitly if your app uses multiple Dynamic clients.
Extension interfaces
Wallet Provider
Connect a custom wallet by implementing the
WalletProvider interface.Custom Functions
Add standalone functions that use
DynamicClient services.Storage
Persist extension state with regular or secure
Storage.Publish
Package and publish your extension to npm.
Related
- Adding Extensions — Use existing chain and addon extensions.
- Creating a Dynamic Client
- Initializing the Dynamic Client