Skip to content

misakey/sso-js-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@misakey/sdk

Misakey is the user account solution for people and applications who value privacy and simplicity. And it’s open source.

Misakey SDK for integrating easy user authentication in your JS application

NPM Version License: MIT

Table of Contents

Installation

Using npm:

npm install @misakey/sdk

Using yarn:

yarn add @misakey/sdk

Getting started

Import and intitialize the configuration

import { useMisakeyAuth } from "@misakey/sdk";

/** Copy this snippet in the config part of your app */
const authConfig = {
  clientId: 'e60ee766-d285-44a6-88c0-2d6e5c4633c1',
  redirectUri: 'http://localhost:3000/callback',
  buttonPlacement: 'top-right',
  userInfoRequirement: ['email'],
}

Integrate the hook in your app

  const { isAuthCallback, isAuthenticated, userProfile } = useMisakeyAuth(authConfig);
  if (isAuthCallback) { return null; }

Use the auth context

  {isAuthenticated ? (
    // Display your logged-in interface
    `Hello ${userProfile.name}`
  ) : (
    // Display your logged-out interface
    'Hello stranger, please signin !'
  )}

Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the contribution guide.

Support + Feedback

For support or to provide feedback, please raise an issue on our issue tracker.

What is Misakey?

Misakey helps you to easily integrate robust user managment into your app.

Why Misakey?

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Source management disclaimer

Misakey uses GitLab for the development of its free softwares. Our Github repositories are only mirrors. If you want to work with us, fork us on gitlab.com (no registration needed, you can sign in with your Github account)

About

The SDK to integrate Misakey's SSO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published