1.4.5 • Published 2 years ago

@ourodemi/idaas-js v1.4.5

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

@ourodemi/idaas-js

A Javascript library that implements Ourodemi's Identity as a Service API. The HTTP API for IDaaS can be found on our website here

Features

  • Manage Access & Refresh Tokens
  • Queue API Requests
  • Obtain & Validate Captchas
  • Create New User Accounts

Note: for React Native, see @ourodemi/idaas-rn

Usage/Examples

Wrap your API calls inside the .request() function as shown below

import IDaaSModule from '@ourodemi/idaas-js';

var AuthModule = new IDaaSModule('myapp-xyz.ourodemi.com');

AuthModule.request(function handler(accessToken){
    // your backend request here
    axios.get('myapi.com/endpoint', {
        headers:{
            'x-access-token': accessToken
        }
    }).then({data, status} => {
        // handle response
    }).catch(err => {
        // handle error
    });
});

Note: You must use the same instance of IDaaS module for all your requests

API Reference

Available methods

MethodReturnsDescription
auth({email, username, password})true\|falseAttempts to authenticate with the specified credentials
deauth()true\|falseSends a request to invalidate the refresh token and removes it from local storage
isAuthenticated()true\|falseChecks if the refresh token is valid
setDeauthHandler()voidSets the deauthHandler() which is invoked when the current session is invalidated
getUser()objectReturns current user's profile. See user object below

User Object

{
    "user_id": "cdad02ec-1e45-458b-8f94-c180a6ef95da",
    "username": "talha",
    "name": "Talha",
    "email": "talha@example.com",
    "groups": [
        "standard"
    ]
}

Badges

MIT License

Feedback

If you have any feedback, please reach out to us at developers@ourodemi.com

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago