sawo
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Sawo

Passwordless and OTP-less Authentication for your website. Check the documentaion here.

Installing

A step by step series of examples that tell you how to get a development env running. These instructions will let you render the form in your speicified container, and allow you to attach successful login callback for futher actions.

Install the sawo package

npm i sawo

Import the Sawo class and verifyToken method from the sawo package

import Sawo from "sawo"

API Key

  • Login to sawo dev console.
  • Create a new project
    • Set Project Name
    • Set Project Host
      • For dev: point to localhost
      • For prod: point to your domain.
  • Copy the API key

Configuration

    var config = {
        // should be same as the id of the container
        containerID: "<container_ID>",
        // can be one of 'email', 'phone_number_sms' or 'both_email_phone'
        identifierType: "phone_number_sms",
        // Add the API key, generated in last step
        apiKey: "",
        // successful Login callback
        onSuccess: (payload) => {},
    };

Create Sawo instance

let sawo = new Sawo(<configuration>)

Call the showForm method

  • "showForm" method is reponsible to render the form in the given container.
sawo.showForm()

After successful setup of Sawo sdk, a login form will rendered in the provided

container. For ex:

Login Form

Project demo links

Authors

Versioning

We use SemVer for versioning. For the versions available,

License

This project is licensed under the MIT License

Package Sidebar

Install

npm i sawo

Weekly Downloads

46

Version

1.0.3

License

MIT

Unpacked Size

4.88 kB

Total Files

4

Last publish

Collaborators

  • sawolabs