Skip to content

monocloud/react-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


React Quickstart

A minimal React SPA example showing how to add authentication with MonoCloud.

What this repo shows

  • MonoCloud authentication in a React SPA
  • Authorization Code + PKCE sign-in, sign-up, and sign-out
  • Handling the sign-in and sign-out callbacks automatically with <MonoCloudAuthProvider>
  • Reading the signed-in user with the useAuth() hook

Built with @monocloud/auth-react.

Prerequisites

Before you begin, you’ll need:

Configure the client

Open src/main.tsx and replace the placeholders with values from your MonoCloud application:

<MonoCloudAuthProvider
  tenantDomain="https://<your-domain>"
  clientId="<your-client-id>"
>
  <App />
</MonoCloudAuthProvider>

Application URLs (local)

Configure these in your MonoCloud app:

  • Callback URL → http://localhost:5173
  • Sign-out URL → http://localhost:5173
  • Cross-Origin URL → http://localhost:5173

Run locally

npm install
npm run dev

Open http://localhost:5173

What to copy from this repo

  • Wrapping the app with <MonoCloudAuthProvider>
  • Reading the authenticated user with useAuth()
  • Sign-in, sign-up, and sign-out actions with the built-in components

This repo is a reference, not a framework.

📘 Learn more

🤝 Contributing & Support

Issues & Feedback

  • Use GitHub Issues for bug reports and feature requests.
  • For tenant or account-specific help, contact MonoCloud Support through your dashboard.

Security

Do not report security issues publicly. Please follow the contact instructions at: https://www.monocloud.com/contact

📄 License

Licensed under the MIT License. See the included LICENSE file.

Releases

No releases published

Packages

 
 
 

Contributors