The Swoop Developer Hub - Password Free Authentication

Welcome to the Swoop developer hub. You'll find comprehensive guides and documentation to help you start working with Swoop as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting started with Swoop only requires 3 lines of Javascript. This guide will show you how to hook up Swoop Authentication to any button on your site.

1. Add the Swoop JS to your page's head

<script src="https://cdn.jsdelivr.net/npm/@swoop-password-free/[email protected]/dist/swoop.js"></script>

2. Initialize Swoop With Your Client ID

Make sure you have registered for a new App in the Swoop Dashboard

<script>
  let swoop = new Swoop("swoop_4wtjd4k7nljf30");
</script>

3. Create an Authentication Function

<script>
    const authenticate = async () => {
    let user = await swoop.in();
    console.log(user);
    // user.email
    // user.id_token
    // user.user_meta
    // Send user.id_token to your backend to complete authentication and log the user in
  }
</script>

4. Call The Authentication Function

<button onclick="authenticate()">Login</button>

And that's it! Your users are now entered into a Password-Free Paradise.

๐Ÿ“˜

Security Note

Once the user is authenticated, you should send the user.id_token to your server to be verified with your CLIENT SECRET to ensure the token is valid.

Updated 28 days ago



HTML/Web


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.