Socket
Socket
Sign inDemoInstall

myanimelist-oauth

Package Overview
Dependencies
8
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    myanimelist-oauth

A simple Oauth 2.0 library for myanimelist API


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

[1.0.2] - 2021-12-17

  • fixed async bug in refresh function
  • resized read me image

Readme

Source

myanimelist-oauth

This is a simple Oauth 2.0 library for myanimelist API hosted on npm. This library can be used in browsers or node.

Note: all the bundles are in the dist directory, so you can pick whichever you want.

Installation

yarn add myanimelist-oauth

Initialization

const malOauth = require("myanimelist-oauth");

Usage

const app = require("express")();
const malOauth = require("myanimelist-oauth");

app.get("/", (req, res) => {
	res.send("hello world");
});

var myanimelist = new malOauth({
	clientID: "your client ID",
	callback: "http://localhost:3000/callback",
	clientSecret: "your client secret", // not required if your application is registered as "Android", "IOS", or "Other"
});

app.get("/auth", myanimelist.authorize);

app.get("/callback", myanimelist.access_token, (req, res) => {
	res.json(req.get_data);
});

app.listen("3000", () => console.log("listening on port 3000"));

Functions

// Initializer
malOauth({
  clientID!: string,
  callback!: string,
  clientSecret?: string,
  codeChallange?: string,
  state?: string
})

authorize() => null // redirects to the uri you specified in your application registration

access_token() => null // middleware that sends final json response to req.get_data

refresh() => {
  'token-type': 'Bearer',
  'expires_in': int,
  'access_token': string,
  'refresh_token'string
}

Contact

  • Author: prince-ao
  • Contact: princeaddo608@gmail.com

Keywords

FAQs

Last updated on 17 Dec 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc