Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

authlify-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authlify-js

Authlify API client for JavaScript

  • 0.3.0
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Authlify JS Client

This is a JS library for the Authlify API.

It lets you signup and authenticate users and is a building block for constructing the UI for signups, password recovery, login and logout.

Usage

import Authlify from 'authlify-js'

const authlify = new Authlify({
  APIUrl: 'https://authlify.netlify.com'
});

authlify.signup(username, email).then(
  (response) => console.log("Confirmation email sent"),
  (error) => console.log("Error during signup: %o", error.msg)
);

authlify.confirm(token).then(
  (user) => console.log("Logged in as %s", user.email),
  (error) => console.log("Failed to log in: %o", error)
);

authlify.requestPasswordRecovery(email).then(
  (response) => console.log("Recovery email sent"),
  (error) => console.log("Error sending recovery mail: %o", error)
);

authlify.recover(token).then(
  (user) => console.log("Logged in as %s", user.email),
  (error) => console.log("Failed to verify recover token: %o", error)
);

user.update({email: newEmail, password: newPassword}).then(
  (user) => console.log("Updated user"),
  (error) => console.log("Failed to update user: %o", error)
);

user.jwt().then(
  (token) => console.log("Current token: %s", token),
  (error) => console.log("Failed to get token: %o", error)
);

user.logout().then(
  (response) => console.log("User logged out"),
  (error) => console.log("Failed to logout user: %o", error)
);

FAQs

Package last updated on 18 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc