0.1.13 • Published 2 years ago

@authdog/js-sdk v0.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@authdog/js-sdk

Installation

The package @authdog/js-sdk can be installed from npm using via a package manager.

with yarn

yarn add @authdog/js-sdk

with npm

npm install @authdog/js-sdk

with pnpm

pnpm add @authdog/js-sdk

Usage

Once @authdog/js-sdk is installed, you can use it like any other npm package.

TypeScript / ES6

import { fetchUserInfos, initializeSession } from "@authdog/js-sdk";

const platformUri = "<AUTHDOG_PLATFORM_URI>";
const environmentId = "<AUTHDOG_APP_ENV_ID>";

const InitDisplayUser = async () => {
      const { Authorization } = initializeSession({ environmentId });
      if (Authorization) {
        fetchUserInfos({
          environmentId,
          Authorization,
          platformUri
        }).then((user: any) => {
          if (user) {
              // display user info in your app
          } else {
              // display unauthorized message
          }
        });
};

JavaScript / ES5

const {fetchUserInfos, initializeSession} = require("@authdog/js-sdk")

const platformUri = "<AUTHDOG_PLATFORM_URI>";
const environmentId = "<AUTHDOG_APP_ENV_ID>";

function() {
    const session = initializeSession({ environmentId });
    const Authorization = session.Authorization;

      if (Authorization) {
        fetchUserInfos({
          environmentId,
          Authorization,
          platformUri
        }).then((user: any) => {
          if (user) {
              // display user info in your app
          } else {
              // display unauthorized message
          }
        });

}

License

Released under the MIT Licence

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago