Skip to content

WalletConnect/cloud-auth-api

Repository files navigation

Cloud Auth API

This is an API built with Express, Prisma and TypeScript which aims to replace our self-hosted Supabase GoTrue instance.

Prerequisites

To run this API, you will need:

  • Node.js (version 16 or higher)
  • npm

Getting Started

  1. Clone this repository to your local machine.
git clone https://github.com/WalletConnect/cloud-auth-api.git
  1. Install the dependencies.
cd cloud-auth-api
npm install
  1. Set up your environment variables
cp .env.example .env
  1. Set up Prisma
npx prisma generate

// optionally, you can run Prisma Studio
npx prisma studio
  1. Start the development server.
npm run dev

The server will start on port 3333. You can access it at http://localhost:3333.

  1. Alternatively you can run the docker containers
docker-compose build && docker-compose up

API Endpoints

This API has the following endpoints:

  • GET /nonce - Gets a nonce.
  • POST /connect - Creates a new user along with a session, an identity and gerenates access and refresh tokens. If the user already exists, it'll get updated and new access and refresh tokens will be generated.

Health checks