1.24.2 • Published 4 days ago

@slashid/react v1.24.2

Weekly downloads
-
License
-
Repository
github
Last release
4 days ago

SlashID React SDK

npm build

Documentation

Check out our developer docs for guides and API documentation. You can also check out the demo on CodeSandbox:

Try on CodeSandbox

Setup

Prerequisites

Your organization needs to sign up with /id to get access to the core SDK and an organization ID.

Your environment should have the following dependencies installed:

  • node.js => v16+
  • react => v16+
  • @slashid/slashid => v1.8+

Installation

After obtaining your organization ID, log in to npm and install the package:

npm install @slashid/react

Basic Usage

Primary way of communicating with the /id APIs is by using the provided useSlashID hook. In order to do so, your app needs to be wrapped in the SlashIDProvider. This provider requires you to pass in the organization ID you received from /id as the value of the oid prop.

import { SlashIDProvider } from "@slashid/react";
import React from "react";
import ReactDOM from "react-dom/client";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
  <React.StrictMode>
    <SlashIDProvider oid="ORGANIZATION_ID">
      <App />
    </SlashIDProvider>
  </React.StrictMode>
);

function App() {
    const { user, logIn } = useSlashID();

    return (
      <>
        <button
          onClick={() =>
            logIn({
              handle: {
                type: "email_address",
                value: "example@email.com",
              },
              factor: { method: "email_link" },
            })
          }
        >
          Log in
        </button>
        <div>
          <code>{user}</code>
        </div>
      </>
  );
}

Once the logIn function resolves, your component will render again with the newly logged-in user object.

1.24.2

4 days ago

1.24.1

5 days ago

1.24.0

12 days ago

1.23.0

19 days ago

1.22.2

24 days ago

1.22.1

27 days ago

1.22.1-preact.1

1 month ago

1.22.1-preact.0

1 month ago

1.22.1-preact.3

1 month ago

1.22.1-preact.2

1 month ago

1.21.0

2 months ago

1.22.0

2 months ago

1.20.0

2 months ago

1.20.0-next.0

2 months ago

1.19.0

3 months ago

1.18.2-beta.0

3 months ago

1.18.1

3 months ago

1.18.1-beta.0

3 months ago

1.18.1-beta.1

3 months ago

1.18.0

3 months ago

1.17.2-beta.3

3 months ago

1.17.2-beta.2

3 months ago

1.17.2-beta.1

3 months ago

1.17.2-beta.0

4 months ago

1.17.2

4 months ago

1.17.1

4 months ago

1.17.0

5 months ago

1.16.6

5 months ago

1.16.5

5 months ago

1.16.4-beta.0

5 months ago

1.16.3

5 months ago

1.16.2

5 months ago

1.16.1

5 months ago

1.16.4

5 months ago

1.14.1

7 months ago

1.14.0

7 months ago

1.12.0

9 months ago

1.16.0

6 months ago

1.8.2

10 months ago

1.6.4

10 months ago

1.8.1

10 months ago

1.8.0

10 months ago

1.11.0

9 months ago

1.15.0

6 months ago

1.13.0

8 months ago

1.15.1

6 months ago

1.9.0

9 months ago

1.7.1

10 months ago

1.7.0

10 months ago

1.9.0-beta.2

10 months ago

1.9.0-beta.1

10 months ago

1.9.0-beta.0

10 months ago

1.8.3

10 months ago

1.10.1

9 months ago

1.10.0

9 months ago

1.6.3

11 months ago

1.5.4

11 months ago

1.6.2

11 months ago

1.5.3

1 year ago

1.6.1

11 months ago

1.6.0

11 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.4.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago