We have released v4.0.0 of the ICP JavaScript SDK libraries. This major release introduces the new unified @icp-sdk/core package, consolidating multiple @dfinity/* packages into a single solution.
What’s New
The only change in v4.0.0 is the introduction of @icp-sdk/core, which unifies the following packages:
@dfinity/agent@dfinity/candid@dfinity/identity@dfinity/identity-secp256k1@dfinity/principal
All the functionalities of the @dfinity/* packages are now re-exported and available through their respective @icp-sdk/core/* submodules, providing better tree-shaking support and a more cohesive developer experience. The following table is a summary of how the submodules have been organized:
| Old Package | New Submodule |
|---|---|
@dfinity/agent |
@icp-sdk/core/agent |
@dfinity/candid |
@icp-sdk/core/candid |
@dfinity/identity |
@icp-sdk/core/identity |
@dfinity/identity-secp256k1 |
@icp-sdk/core/identity/secp256k1 |
@dfinity/principal |
@icp-sdk/core/principal |
Nothing else has changed compared to the v3, making the migration to the new package simple and fast!
For detailed upgrading instructions, see our V4 Upgrading Guide.
Automatic Migration Tool
We’ve made upgrading as smooth as possible with our new CLI migration tool:
npx @icp-sdk/core-migrate@latest
This tool automatically updates your imports and package dependencies!
For more information, see our V4 Upgrading Guide.
Package Deprecation
As previously announced, @dfinity/use-auth-client has been deprecated. We recommend migrating to more adopted packages like:
- ic-use-internet-identity (thanks @kristofer!)
- @ic-reactor/react (thanks @b3hr4d!)
Unified Documentation Portal
As part of this rebranding initiative, we’re also unifying the documentation for all ICP JavaScript libraries under the single js.icp.build portal. Each @icp-sdk/* package will have its dedicated documentation path on the portal (e.g., js.icp.build/core/, js.icp.build/auth/, etc.), providing developers with a centralized location to find comprehensive documentation and guides for all ICP JavaScript tools.
This opens new possibilities even for community contributions: in the future, libraries created and maintained by the community could also find their place in the unified docs portal!
Visit the new js.icp.build portal!
Future Work
Rename the source code repo(done)dfinity/agent-jsintodfinity/icp-js-coreas part of the ongoing rebranding initiative@dfinity/assetsand@dfinity/auth-clientwill be included in new@icp-sdk/*packages as part of the ongoing rebranding initiative- Additional ICP JavaScript libraries will migrate to the
@icp-sdk/*namespace in the near future - Continued improvements to the developer experience and the docs
- Further in the future: deprecation of the
@dfinity/agent,@dfinity/candid,@dfinity/identity,@dfinity/identity-secp256k1and@dfinity/principalpackages, in favor of a bigger rework of@icp-sdk/corepackage
