New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ntnui-tools

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

ntnui-tools

An npm package with a collection of tools for easier utilization of NTNUI API.

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

ntnui-tools

An npm package with a collection of tools for easier utilization of NTNUI API.

Installation

npm i ntnui-tools

The default API URL is https://api.ntnui.no. Change it by setting NTNUI_TOOLS_API_URL as an environment variable during development.

# .env in your project
NTNUI_TOOLS_API_URL = 'https://dev.api.ntnui.no'

Example usage

import { getNtnuiToken } from 'ntnui-tools'

// Log in using NTNUI membership system credentials
const tokens = await getNtnuiToken(phone_number, password)

// Use tokens to access the NTNUI API
const role = await getRoleInGroup(slug, tokens.access)
// => returns group role of the user, e.g. "board_member"

Methods

function getNtnuiProfile(token: string): Promise<IUserProfileResponse>

function getRoleInGroup(
	group_slug: string,
	token: string
): Promise<string | null>

function getNtnuiToken(
	phone_number: string,
	password: string
): Promise<INtnuiTokens>

function isValidNtnuiToken(token: string): Promise<boolean>

function refreshNtnuiToken(token: string): Promise<INtnuiAccessToken>

Keywords

ntnui

FAQs

Package last updated on 17 Feb 2023

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