oa-auth-client
v0.0.6
Published
oa auth client
Readme
OA Auth Client
The OA Authentication Helper Library. The OA Auth helper library lets you write javascript code to make HTTP requests to the OA-Auth API. This library is intended for front-end, client-side applications using React, React Native, or plain HTML/CSS/Javascript.
Visit Docs for more info.
Install
This package is published on github package registry
- Login to Github Package registry
npm login --registry=https://npm.pkg.github.com --scope=@obsidian-achernar- Create a
.yarnrcforyarnand.npmrcfornpm
"@Obsidian-Achernar:registry" "https://npm.pkg.github.com"With npm:
npm install @obsidian-achernar/oa-auth-clientor with yarn:
yarn add @obsidian-achernar/oa-auth-clientUsage
const url = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // Your OA auth URL
const headers = {}; // Your OA tokens ( accessToken, refreshToken, idToken )
import Auth from 'oa-auth';
const client = Auth({ url, headers });
(async () => {
const { data, error } = await client.getCountries();
console.log('data', data);
console.log('error', error);
})();