npm.io
1.2.4 • Published 1 year ago

@open-age/client

Licence
WTFPL
Version
1.2.4
Deps
0
Size
19 kB
Vulns
0
Weekly
0

directory-client

Client to interact with the user

config

add following section to the config/{env}.config file

"providers": {
    "directory": {
        "url": "http://api.openage.in/directory/v1/api", // prod url
        "role": {
            "key": "<presistant token>"
        }
    }
}

usage

Get a role by key


const client = require('@open-age/client')

const roleKey = 'xxx....xxx' // role key of the user

// impersonates the user
const role = await client.directory.roles.get(roleKey)

Keywords