Overview
micro-stacks
is an all-in-one TypeScript SDK for interacting with the Stacks ecosystem. With
micro-stacks
you can build software that can: interact with Clarity, the smart contract langauge
on Stacks, build apps that interact with Stacks based wallets, construct transactions, post
conditions, and more!
pnpm i @micro-stacks/react@beta
Building apps
Check out these core patterns for building robust Stacks applications.
Available libraries
These are the packages you can use:
- React: if you're building a Vue app, use this.
- Svelte: if you're building a Svelte app, use this (coming soon).
- Vue: if you're building a Vue app, use this (coming soon).
- Client: if you're building a non-react app, use this.
- Core: if you're building something lower level, use this.
Here is a handy table to understand which library to use:
Use case | Module to use |
---|---|
Building a react based app | React: @micro-stacks/react |
Building a svelte app | Client module: @micro-stacks/svelte (coming soon) |
Building a vue app | Client module: @micro-stacks/vue (coming soon) |
Building an angular app | Client module: @micro-stacks/client |
Handling Stacks user sessions in vanilla javascript | Client module: @micro-stacks/client |
Working with Clarity values | Core module: micro-stacks/clarity |
Constructing transactions in node.js | Core module: micro-stacks/transactions |
Converting values to and from byte arrays | Core module: micro-stacks/common |
Core modules
At the foundation of all this tooling is the base library, micro-stacks
. This library contains the
lowest level code which all other packages make use of. Most developers will likely interact with
packages higher up in this stack, such as the Client module or React specific tooling. The core
modules are: Clarity, Connect, Crypto, Network, Storage, and Transactions.
Use these modules if you're parsing Clarity values, interacting with buffers (byte arrays), or building lower-level functionality.
Client module
The Client module is what any kind of Stacks based app is likely going to use to add Stacks-specific functionality. This means if you are going to have your users sign messages or transactions, save data, or encrypt data, and you are not building a React based application, the Client module is what you want to use. If you are building a React application, you should check out the React tooling docs.
Use this module if you are handling Stacks user session and not building a React app.
React
The React library offers many quality of life and developer experience improvements over using either the Client module or the Core modules by themselves. The React library exports many different hooks and components that make building Stacks apps fun and easy.
Use this module if you are building a React-based Stacks app.