Skip to main content

Getting Started


A newer version of this page is available in the Developer Hub. Click here to read it.

This page aims to help you get started with Candy Machines by listing all relevant libraries that interact with them.


If you are developing for the web or using Node.js, then we have a few libraries at your disposal.

Metaplex provides a Umi-compatible library that can be used to interact with Candy Machines. Thanks to the Umi framework, it ships without any opinionated dependencies and, thus, provides a lightweight library that can be used in any JavaScript project.

To get started, you'll need to install the Umi framework and the Umi-compatible Candy Machine library β€” which is currently under the alpha tag.

npm install \
@metaplex-foundation/umi \
@metaplex-foundation/umi-bundle-defaults \
@solana/web3.js \

Next, you may create your Umi instance and install the mplCandyMachine plugin like so.

import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { mplCandyMachine } from "@metaplex-foundation/mpl-candy-machine";

// Use the RPC endpoint of your choice.
const umi = createUmi("").use(mplCandyMachine());

That's it, you can now interact with Candy Machines by using the various functions provided by the library and passing your Umi instance to them. Here's an example of fetching a candy machine account and its associated candy guard account.

import { publicKey } from "@metaplex-foundation/umi";
import {
} from "@metaplex-foundation/mpl-candy-machine";

const candyMachinePublicKey = publicKey("...");
const candyMachine = await fetchCandyMachine(umi, candyMachinePublicKey);
const candyGuard = await fetchCandyGuard(umi, candyMachine.mintAuthority);

πŸ”— Helpful Links:

Solita library​

Before releasing the Umi framework, we provided program-specific libraries generated by Solita which are still available for you to use. Since candy machines are composed of two programs, you will need to install two libraries.


Before releasing the Umi framework, we provided a monolithic JavaScript SDK that encapsulated the Solita library into one big heavy API. This SDK is still available for you to use but we now recommend using the Umi library instead. Also, note that the JS SDK does not support minting Programmable NFTs.

Once the JS SDK is installed, you can access its Candy Machine module via metaplex.candyMachines(). It is composed of several methods that focus on real use cases to make our life easier. Here are some of them.


πŸ”— Helpful Links:


If you are developing in Rust, you can also use the Rust crates to interact with Metaplex’s programs. Since our programs are written in Rust, these crates should contain everything you need to parse accounts and build instructions.

This can be helpful when developing Rust clients but also when making CPI calls to Metaplex programs within your own program.


Coming soon.


Coming soon.