Introducing Stacks.js, everything you need to build apps on Stacks 2.0 in one place
Until today, building Stacks apps required developers to understand and import multiple libraries, some with overlapping or incomplete features. This was not only a bad experience, but importing all libraries also increases app size and complexity.
Enter: Stacks.js beta .
Stacks.js is a reorganization of libraries in the Stacks ecosystem, composed of nine modular libraries all residing inside a single Github repository. With Stacks.js, you get everything you need to build apps on Stacks 2.0 in one place, including functionalities like storage, auth, and Clarity smart contracts.
The following packages are now available on NPM:
- @stacks/auth Construct and decode authentication requests for Stacks apps.
- @stacks/storage Store and fetch files with Gaia, the decentralized storage system.
- @stacks/transactions Construct/decode transactions and work with Clarity smart contracts on the Stacks blockchain.
- @stacks/cli Command line interface to interact with auth, storage and Stacks transactions.
- @stacks/keychain Create and manage keys/wallets for the Stacks blockchain.
- @stacks/network Network and API library for working with Stacks blockchain nodes.
- @stacks/encryption Encryption functions used by Stacks.js packages.
- @stacks/profile Functions for manipulating user profiles.
- @stacks/common Common utilities used by Stacks.js packages.
The documentation is already updated so new developers won’t ever experience the challenges you OGs did. For the OGs with existing Stacks apps, here is a migration guide to help you switch over to Stacks.js. Most notably, you will have to update your imports to use packages from the new @stacks scope on NPM. As always, just pop into Discord or post here if there’s anything we do to help.
Many thanks to those of you that contributed with feedback, this all started with the Stacks Monorepo RFC and we’re excited to be delivering it now!
Check out the Stacks.js monorepo