Socket
Book a DemoInstallSign in
Socket

metrafin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metrafin

Official Metrafin API Client for Node.js

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Metrafin API Node

Official Metrafin API Client for Node.js

GitHub | NPM | Official API Documentation

Install

npm i metrafin
const App = require('metrafin')

Use

Create application

Create an application with its private token.

const myApp = new App('VLeIjSNigss5eqLcNf5Snv2kh_d-HWOv1-ojr952gpW0CyKt')

Resolve users

// in async context

const userInfoA = await myApp.resolveUser('username', 'ethan')

// or...

const userInfoB = await myApp.resolveUser('userId', '9175009b-b215-4be8-a3a8-88322757804d')

Use an authToken

const auth = await myApp.getAuth('rmxQPAll1kEhsc8u-IPwBkwyNdixJCSf')

console.log('Auth userId: ' + auth.userId)
console.log('Auth scopes: ' + auth.scopes)
console.log('Auth expires: ' + auth.expires)

Get user profile

See profile information documentation for details about the profile response.

await auth.getProfile()

Get user permissions

await auth.getPermissions()

Get user HonorScore

await auth.getHonorScore()

Create reputation event

See reputation event documentation for details about reputation events.

await auth.createReputationEvent({
	'context': 'public_comment',
	'tag': 'spam',
	'type': 'negative',
	'description': 'Excessive commenting on a video'
})

List reputation events

await auth.getReputationEvents()

Update active status of reputation event

await auth.setReputationEventActive('ef8c4ce3-2f02-4647-ab5e-727387184e15', false)

// This will deactivate the reputation event with ID ef8c4ce3-2f02-4647-ab5e-727387184e15.

Feedback and questions

If you have questions or feedback about the package, feel free to let us know in GitHub issues.

Feel free to contribute through PRs as well. :)

Keywords

metrafin

FAQs

Package last updated on 22 Sep 2019

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