Usage
Here's a step-by-step guide to quickly set up SiteAuth in your project. Choose the method that best suits your project and follow the instructions below.
React
Follow these steps to set up SiteAuth in your React app.
Steps
- Create an account on Site Auth.
- Get Website ID by adding your website and users to the Site Auth dashboard.
- Install Package
npm install site-auth-react
- Wrap your app with `SiteAuthProvider` in `App.js`.
import { SiteAuthProvider } from 'site-auth-react'; function App() { return ( <SiteAuthProvider> <YourAppComponents /> </SiteAuthProvider> ); }
- Use the `SiteAuthScreen` component for authentication:
import { SiteAuthScreen } from 'site-auth-react'; function AuthPage() { return ( <SiteAuthScreen websiteId="your-website-id" /> ); }