Options
All
  • Public
  • Public/Protected
  • All
Menu

A8 Connect Server - v2.1.19

codecov

Description

Ancient8 Connect UMD library.

This is the server APIs version. The implementation below will be only valid when in nodejs environment.

Documentation

For detail of browser APIs please refer the docs.

For detail of server APIs please refer the docs.

For detail of adapter APIs please refer the docs.

Installation

$ yarn add @ancient8/connect

Examples

Please see the demo here

Usages

2 main usages for A8ServerConnect.

  1. Use OAuth APIs.
/**
* Use OAuth APIs
*/

import {
init,
Types,
getA8ServerConnectInstance
} from "@ancient8/connect/server"

init({
// Must initialize with oauth credential
withOAuthCredential: oauthCredential as Types.ConnectOAuthDto.OAuthCredential
});

const instance = getA8ServerConnectInstance();

const authorizedUserId = "abcyxz";

console.log(
await instance.currentSession.OAuth.getUserInfo(authorizedUserId)
);
  1. Use Non-Oauth APIs
/**
* Use non-oauth APIs
*/

import {
init,
getA8ServerConnectInstance
} from "@ancient8/connect/server"

init({
// can be bearer jwt (can be obtained after successfully login)
withCredential: authToken as string,

// or use cookie credential (extracted from request header)
withCookieCredential: cookieCredential as string,
});

const instance = getA8ServerConnectInstance();

console.log(
await instance.currentSession.User.getUserProfile()
);

Notes

This library is still in beta development. Significant changes may happen anytime.

Contact

If you have any inquiries please send emails to [email protected].

License

Copyright (c) 2022 Ancient8.

Licensed under the GPL-3.0

Generated using TypeDoc