Skip to content

nickgarfield/feather-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feather React Demo

Add authentication to your app in 5 minutes.

1. Get an API key

Go the https://feather.id and create an account to get your project's API key.

2. Initialize the client

$ yarn add feather-client-react
import { Feather } from "feather-client-react";

const feather = Feather("pk_test_....");

feather.onStateChange((currentSession, currentUser) => {
  // Get updates anytime your app's authentication state changes
});

3. Add a sign-in flow

import { PasswordAuthenticationForm } from "feather-client-react";

function SignIn() {
  return (
    <PasswordAuthenticationForm
      feather={feather}
      redirectUrl="http://yourapp.com/resetPassword"
    />
  );
}

4. Add password-reset flow

feather
  .confirmForgotPasswordLink(window.location.href, "new_p4ssw0rd")
  .catch(error => {
    // Display an error message
  });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published