This is Niftory's Walletless Onboarding Starter built on Next.js that uses the Niftory API. Use this app as inspiration to easily bring your users into Web3, without a wallet!
This app auto-generates a custodial wallet that you can use for customers and allows you to attach additional wallets as well. In the future, we'll be adding support for Flow's hybrid custody features.
This app uses dotenv for configuration, so you can set your app's environment variables by creating a .env
file in this directory.
See .env.example for an example of how to configure these environment variables.
To install the dependencies of this app.
yarn install
Once your .env
file is set up, you can run the app locally with:
yarn dev
- Web framework: Next.js
- Auth framework: NextAuth
- Graph QL Client: graphql-request
- React state management: urql and SWR
- GraphQL codegen: graphql-codeg-generator
This app demonstrates three forms of authentication in the Niftory API.
We use NextAuth to manage user sessions in this app.
Our configuration uses Niftory as the only OAuth provider and saves the user's Niftory token in the session.
The browser's GraphQL client then includes that token in every request to the Niftory API as a bearer token in the Authorization
header
If you want to make requests using the app's credentials instead of the User's credentials for performing admin only tasks then that can be done using the Serverside GraphQL Client.
Note - This client should not be used in the frontend, it should either be used in the backend of your app or in the NextJS API Routes.