/Rent-It-Up

Rent Anything

Primary LanguageTypeScript

Walletless Onboarding Starter

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.

Usage

Configuration

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.

Installing Dependencies

To install the dependencies of this app.

yarn install

Running the app

Once your .env file is set up, you can run the app locally with:

yarn dev

Overview

Stack:

Authentication

This app demonstrates three forms of authentication in the Niftory API.

User authentication

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

App Credentials authentication using NextJS API routes or in your backend.

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.