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

  1. Create an account on Site Auth.
  2. Get Website ID by adding your website and users to the Site Auth dashboard.
  3. Install Package
    npm install site-auth-react
  4. Wrap your app with `SiteAuthProvider` in `App.js`.
    import { SiteAuthProvider } from 'site-auth-react';
    
    function App() {
        return (
            <SiteAuthProvider>
            <YourAppComponents />
            </SiteAuthProvider>
        );
    }
    
  5. Use the `SiteAuthScreen` component for authentication:
    import { SiteAuthScreen } from 'site-auth-react';
              
    function AuthPage() {
      return (
          <SiteAuthScreen websiteId="your-website-id" />
      );
    }