Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@acceleratxr/core_sdk

Package Overview
Dependencies
Maintainers
0
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acceleratxr/core_sdk

  • 3.1.0-alpha.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
325
increased by238.54%
Maintainers
0
Weekly downloads
 
Created
Source

client_sdk_nodejs

Client SDK for working with AcceleratXR powered services.

Yarn

yarn add @acceleratxr/core_sdk

NPM

npm i @acceleratxr/core_sdk

Usage

SDK Initialization

To setup and initilize the SDK...

JavaScript

const { Configuration, CoreSDK } = require("@acceleratxr/core_sdk");

var config = new Configuration({
    baseUrl: "http://localhost:3000",
});
var sdk = new CoreSDK(config);

TypeScript

import { Configuration, CoreSDK } from "@acceleratxr/core_sdk";

const config: Configuration = new Configuration({
    baseUrl: "http://localhost:3000",
});
const sdk: CoreSDK = CoreSDK(config);

Account Registration

To register a new user account...

JavaScript

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");

TypeScript

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");

Device Login

JavaScript

const { User } = require("@acceleratxr/core_sdk");

await sdk.loginDevice();
var user = sdk.loggedInUser;

TypeScript

import { User } from "@acceleratxr/core_sdk";

await sdk.loginDevice();
const user: User = sdk.loggedInUser;

User/Pass Login

To authenticate using basic username and password...

JavaScript

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;

TypeScript

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;

Password-less Login

To authenticate using password-less login via e-mail or phone...

JavaScript

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;

TypeScript

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;

Single-Sign On (OAuth)

To authenticate using an OAuth compatible single-sign on provider...

JavaScript

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;

TypeScript

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;

License

This software is licensed under a custom XBE EULA. By using it, you agree to the terms.

FAQs

Package last updated on 30 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc