Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Repository files navigation

Privy Auth + Solana create-next-solana-app Starter

This repository is archived. For up-to-date examples, please visit github.com/privy-io/examples.

This is a template for integrating Privy's Solana capabilities into a Next.js application. It provides a simple setup for wallet login, embedded wallets, and transaction signing using the Privy React SDK.

This demo uses NextJS's App Router.

Setup

  1. Clone this repository and open it in your terminal.
git clone https://github.com/privy-io/create-next-solana-app.git && cd create-next-solana-app
  1. Install the dependencies.
npm install
  1. Define the environment variables in a .env.local file.
cp .env.local.example .env.local

Building locally

In your project directory, run npm run dev. You can now visit http://localhost:3000 to see your app and login with Privy!

Check out

  • components/providers.tsx for how to use the PrivyProvider and initialize it with your Privy App ID.
  • app/page.tsx for how to verify if a user is logged in from a server component.
  • components/loginButton.tsx for how to use the useLogin Privy hook to log in a user and create an embedded wallet.
  • app/dashboard/page.tsx for how to use the usePrivy hook to access the Privy SDK in a client component, and how to use the embedded and EOA wallets to sign a message and send a transaction.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages