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

oasis-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oasis-api

A JavaScript proxy for the Oasis API. To be used only in the browser.

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

OASIS API

This package is for client applications to connect and work with the OASIS API

  • OASIS API

Getting started

To get started with this package run

npm install oasis-api

This installs the package to your project. To use it in the Application, it can be imported by

import oasis from "oasis-api"

Auth

The Auth class handles the authentication of the oasis-api. It can be imported by:

import { Auth } from "oasis-api"

Login

To login use this code:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const user = await oasisAuth.login({
  email: "email@test.com",
  password: "testpass",
});

Signup

For signup, use this code snippet:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.signup({
  firstName: "test",
  lastName: "test",
  email: "test@email.com",
  password: "test",
  confirmPassword: "test",
  acceptTerms: true,
  avatarType: "User",
  title: "Mr",
});

Logout

This logs a user out and revokes his token

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.logout();

Forgot password

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.forgotPassword({ email: "test@test.com" });

Get user

This function is used when trying to get a currently logged in user. Code snippet:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.getUser();

Avatar

This class manages a user's avatar from adding Karma, deleting and updating avatar, etc,

import { Avatar } from "oasis-api";
const avatar = new Avatar();

get

This function gets an avatar when its ID is provided

import { Avatar } from "oasis-api";
const avatar = new Avatar();

const res = await avatar.get();

Get All

This function returns all registered avatars

import { Avatar } from "oasis-api";
const avatar = new Avatar();

const res = await avatar.getAll();

Keywords

FAQs

Package last updated on 09 Apr 2022

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