Getting started
Build your first Solana app with Kit
In this tutorial, we'll build a small Solana app with Kit. We'll create a devnet signer, fund it with devnet SOL, create a token mint, and read its data back — all with a plugin-composed Kit client.
Install dependencies
First, let's install Kit and the plugins for connecting to Solana via RPC and loading a signer.
Then install the program plugins for the Solana programs you want to interact with. For this tutorial, we'll use the Token program to create and read a token mint.
Create a devnet signer
Before we start, let's create a signer that we can reuse across this tutorial. This one-time setup script grinds a small vanity address, makes the keypair extractable, and writes it to a local file in the same JSON format used by Solana CLI keypairs.
Run this script once, then remove it from your project. We'll keep the generated kit-getting-started-keypair.json file locally for the rest of this tutorial. Be sure to add it to .gitignore if you are planning on committing these changes.
Already have a Solana CLI keypair? You can skip this script and use
signerFromFile('~/.config/solana/id.json') instead. See Setting Up
Signers for more signer options.
Create a client
Now let's create a client connected to devnet and load the signer from the file we just wrote.
Here's what each piece does:
createClient()creates an empty Kit client that can be extended with plugins..use(signerFromFile(...))loads our keypair file and sets it as both the client's payer (who pays fees) and identity (who owns assets)..use(solanaDevnetRpc())connects to devnet and adds RPC, subscriptions, airdrops, minimum balance helpers, and transaction sending..use(tokenProgram())adds typed access to the Token program's instructions and accounts.
Because we just created a fresh devnet signer, it won't have any SOL yet. Let's fund it with a devnet airdrop before moving on. If you're reusing a signer that already has devnet SOL, you can skip this step.
Airdrops are only available on test networks like devnet and localhost. Run the airdrop once, then remove or comment out those lines before continuing so we do not hit devnet faucet rate limits. If the airdrop fails, wait a moment and try again, or request devnet SOL from the Solana Faucet.
Send a transaction
Let's create a token mint onchain. In Solana, every transaction contains one or more instructions: small commands that tell programs what to do. Some tasks, like creating a mint, require multiple instructions that should stay together. Kit represents that kind of multi-step operation as an instruction plan.
The Token program plugin gives us one of these plans via client.token.instructions.createMint(...). Under the hood, it creates a new account for the provided mint address with enough lamports to be rent-exempt (system program's createAccount instruction) and initializes it as a Token program mint (token program's initializeMint instruction). We pass the new mint as a signer (since we initialize a new account), choose 9 decimals, and set our client identity as the mint authority.
client.sendTransaction([...]) accepts an array of instructions and instruction plans and sends them as a single transaction. If one part fails, the whole transaction fails. This is the most common way to send transactions with a client, especially when we want to combine several instructions or plans.
For simple one-off operations, program instruction helpers also include a .sendTransaction() shortcut. The following sends the same createMint instruction plan as a single transaction without explicitly calling client.sendTransaction([...]).
For error handling, priority fees, and more advanced patterns, see the Sending Transactions guide.
Fetch an account
Now let's read the mint account we just created.
Program plugins provide typed fetch helpers that decode account data automatically. The mintAccount.data object gives us the full Mint structure with fields like decimals, mintAuthority, supply, and freezeAuthority.
For raw account fetching and manual decoding, see the Fetching Accounts guide.
Full example
Here's the complete script you can copy and run after creating kit-getting-started-keypair.json.
Next steps
We've connected to devnet, funded a signer, created a token mint, and read its data. Here's where to go next:
- Setting Up Signers — load signers from keypair files, wallet standard, and more.
- Sending Transactions — error handling, priority fees, and instruction plans.
- Fetching Accounts — program plugin fetch helpers, batch fetching, and decoding.
- Using Program Plugins — typed access to any Solana program.
- Plugins — understand and extend the plugin system.