Client SDK for working with AcceleratXR powered services.
yarn add @acceleratxr/core_sdk
npm i @acceleratxr/core_sdk
To setup and initilize the SDK...
const { Configuration, CoreSDK } = require("@acceleratxr/core_sdk");
var config = new Configuration({
baseUrl: "http://localhost:3000",
});
var sdk = new CoreSDK(config);
import { Configuration, CoreSDK } from "@acceleratxr/core_sdk";
const config: Configuration = new Configuration({
baseUrl: "http://localhost:3000",
});
const sdk: CoreSDK = CoreSDK(config);
To register a new user account...
const { Profile, User } = require("@acceleratxr/core_sdk");
var user = new User({
name: "username",
givenName: "John",
familyName: "Smith",
email: "john.smith@gmail.com"
});
user = await sdk.registerUser(user);
// or
user = await sdk.registerUserAndPassword(user, "password");
import { Profile, User } from "@acceleratxr/core_sdk";
let user: User = new User({
name: "username",
givenName: "John",
familyName: "Smith",
email: "john.smith@gmail.com"
});
user = await sdk.registerUser(user);
// or
user = await sdk.registerUserAndPassword(user, "password");
const { User } = require("@acceleratxr/core_sdk");
await sdk.loginDevice();
var user = sdk.loggedInUser;
import { User } from "@acceleratxr/core_sdk";
await sdk.loginDevice();
const user: User = sdk.loggedInUser;
To authenticate using basic username and password...
const { User } = require("@acceleratxr/core_sdk");
sdk.onAuthChallenge = async () => {
// Capture TOTP code from user
return totp;
}
await sdk.loginPassword("username","password");
var user = sdk.loggedInUser;
import { User } from "@acceleratxr/core_sdk";
sdk.onAuthChallenge = async () => {
// Capture TOTP code from user
return totp;
}
await sdk.loginPassword("username","password");
var user = sdk.loggedInUser;
To authenticate using password-less login via e-mail or phone...
const { User } = require("@acceleratxr/core_sdk");
await sdk.loginEmail("username");
// or
await sdk.loginPhone("username");
// Wait for user input of code
await sdk.loginEmail("username","code");
// or
await sdk.loginPhone("username", "code");
var user = sdk.loggedInUser;
import { User } from "@acceleratxr/core_sdk";
await sdk.loginEmail("username");
// or
await sdk.loginPhone("username");
// Wait for user input of code
await sdk.loginEmail("username","code");
// or
await sdk.loginPhone("username", "code");
const user: User = sdk.loggedInUser;
To authenticate using an OAuth compatible single-sign on provider...
const { User } = require("@acceleratxr/core_sdk");
// Retrieve the auth URL of the OAuth provider
var url = await sdk.requestOAuth2(OAuth2Provider.DISCORD);
// Redirect user to URL and await callback return
await sdk.loginOAuth2(OAuth2Provider.DISCORD, code);
var user = sdk.loggedInUser;
import { User } from "@acceleratxr/core_sdk";
// Retrieve the auth URL of the OAuth provider
var url = await sdk.requestOAuth2(OAuth2Provider.DISCORD);
// Redirect user to URL and await callback return
await sdk.loginOAuth2(OAuth2Provider.DISCORD, code);
const user: User = sdk.loggedInUser;
This software is licensed under a custom XBE EULA. By using it, you agree to the terms.