Rudragiri Gosai

Flows Auth: Svelte Authentication Library with WebAuthn Support

Flows Auth

Welcome to the Flows Auth repository! This library provides robust authentication solutions tailored for Thepia Flow applications, with a focus on modern security practices, including WebAuthn and passkey support.

Table of Contents

Features

Installation

To install the Flows Auth library, run the following command:

npm install flows-auth

Make sure to include the library in your Svelte project to start using its features.

Usage

Here’s a basic example of how to implement Flows Auth in your Svelte application.

Setting Up

First, import the library into your Svelte component:

import { Auth } from 'flows-auth';

Initializing Authentication

You can initialize the authentication process as follows:

const auth = new Auth({
    // Your configuration options
    clientId: 'YOUR_CLIENT_ID',
    redirectUri: 'YOUR_REDIRECT_URI',
});

Logging In

To log in a user, call the login method:

auth.login()
    .then(response => {
        console.log('Login successful:', response);
    })
    .catch(error => {
        console.error('Login failed:', error);
    });

Logging Out

Logging out is just as straightforward:

auth.logout()
    .then(() => {
        console.log('Logout successful');
    })
    .catch(error => {
        console.error('Logout failed:', error);
    });

Handling WebAuthn

For WebAuthn, you can utilize the built-in methods to manage user credentials:

auth.registerWebAuthn()
    .then(credential => {
        console.log('WebAuthn registration successful:', credential);
    })
    .catch(error => {
        console.error('WebAuthn registration failed:', error);
    });

API Reference

Auth Class

Options

Contributing

We welcome contributions! To contribute to Flows Auth, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

To download the latest version of Flows Auth, visit the Releases section. Make sure to execute the downloaded files as per the instructions provided.

For the latest updates, check the Releases section frequently.

Topics

Support

For support, please open an issue in the GitHub repository. We aim to respond promptly to any questions or concerns.

Acknowledgments

Thanks to the Svelte community for their contributions and support. This library builds on the great work done by others in the field of web authentication.

Svelte

Contact

For inquiries, you can reach out via the GitHub issues page or contact the repository owner directly.


By using Flows Auth, you can simplify the authentication process in your applications while ensuring a high level of security.