0.10.2 β€’ Published 9 months ago

@nopwdio/sdk-js v0.10.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Nopwd JavaScript SDK

Welcome to the Nopwd JavaScript SDK repository!

This repository contains all the source code used to build our JavaScript library.

What is it?

Nopwd is a set of web components and APIs to authenticate your users using email links or Passkeys.

Nopwd is still in beta. The API and components may change and are not production-ready at this time.

Check out our demo website to see it live :)

Why?

Authentication used to be hard for users and developers. At Nopwd, we work hard to keep our API simple and minimal πŸ’†. Using Nopwd, you won’t have to:

  • give us money (but you can still support us πŸ˜…)
  • register your app or website
  • manage any API keys or secrets

How to install it?

You can load our web components via CDN or install them locally using a package manager such as NPM.

Using CDN

<!-- Import the login with magic link or Passkeys input element -->
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@nopwdio/sdk-js@latest/cdn/components/np-login.js"
></script>

<!-- Import the logout button element -->
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@nopwdio/sdk-js@latest/cdn/components/np-logout.js"
></script>

<!-- Import the Passkey registration button element -->
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@nopwdio/sdk-js@latest/cdn/components/np-passkey-register.js"
></script>

Using NPM

npm i @nopwdio/sdk-js@latest

Then:

// Import the login with magic link or Passkeys input element
import "@nopwdio/sdk-js/dist/components/np-login.js";

// Import the logout button element
import "@nopwdio/sdk-js/dist/components/np-logout.js";

// Import the Passkey registration button element
import "@nopwdio/sdk-js/dist/components/np-passkey-register.js";

How to add magic-link or Passkeys authentication?

<np-login></np-login>

<script>
  const input = document.querySelector("np-login");

  input.addEventListener("np:login", (e) => {
    // You are authenticated πŸŽ‰
    const { expires_at, token } = e.target.getSession();
  });
</script>

How to logout?

<np-logout></np-logout>

<script>
  const button = document.querySelector("np-logout");

  button.addEventListener("np:logout", (e) => {
    // You are logged out πŸŽ‰
  });
</script>

How to create a Passkey?

<np-passkey-register></np-passkey-register>

<script>
  const button = document.querySelector("np-passkey-register");

  button.addEventListener("np:register", (e) => {
    // The Passkey has been created πŸŽ‰
  });
</script>

New contributors welcome!

You can create a new issue to put a problem on our radar or submit a pull request!

What's next?

Read the full documentation

0.10.1

9 months ago

0.10.2

9 months ago

0.10.0

10 months ago

0.9.12

10 months ago

0.9.11

10 months ago

0.9.8

1 year ago

0.9.7

1 year ago

0.9.9

1 year ago

0.9.10

1 year ago

0.9.6

1 year ago

0.9.0

1 year ago

0.9.2

1 year ago

0.7.4

1 year ago

0.9.1

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.5

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.3

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.16

1 year ago

0.5.14

1 year ago

0.5.15

1 year ago

0.5.13

1 year ago

0.5.12

1 year ago

0.5.11

2 years ago

0.5.10

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.4.37

2 years ago

0.4.36

2 years ago

0.5.3

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.35

2 years ago

0.4.31

2 years ago

0.4.32

2 years ago

0.4.30

2 years ago

0.4.33

2 years ago

0.4.34

2 years ago

0.4.28

2 years ago

0.4.29

2 years ago

0.4.26

2 years ago

0.4.27

2 years ago

0.4.24

2 years ago

0.4.25

2 years ago

0.4.23

2 years ago

0.4.20

2 years ago

0.4.21

2 years ago

0.4.22

2 years ago

0.4.19

2 years ago

0.4.17

2 years ago

0.4.18

2 years ago

0.4.15

2 years ago

0.4.16

2 years ago

0.4.14

2 years ago

0.4.13

2 years ago

0.4.11

2 years ago

0.4.12

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.4.0

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago