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

byu-request

Package Overview
Dependencies
Maintainers
8
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

byu-request

a simple npm module for making api requests to BYU (api.byu.edu)

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

byu-request

Usage

The byu-request module looks for the BYU client id and the BYU client secret in the following order:

  1. In the config as byuClientId and byuClientSecret
  2. Environment variables called BYU_CLIENT_ID and BYU_CLIENT_SECRET
  3. In the parameter store as part of a handel environment (handel.readthedocs.io)
  4. In the parameter store with an ssmParameterHeader supplied in the config
var byuRequest = require('byu-request')

/* Config Option 1 */
/* byuRequest.config({
    "byuClientId": "a1b2c3d45f",
    "byuClientSecret": "123456789abcdefghijklmn"
}) */

/* Config Options 2 does not require the config object */

/* Config Option 3 */
/* byuRequest.config({
    "awsRegion": "us-west-2"
}) */

/* Config Option 4 */
/* byuRequest.config({
    "ssmParameterHeader": "myapp.dev",
    "awsRegion": "us-west-2"
}) */

const byu = byuRequest.request;

var requestOptions = {
    'url': 'https://y-stg.byu.edu/ae/prod/class_schedule/cgi/courseSection.cgi/json/20175/psych/350/001',
    'method': 'GET',
    'headers': {
        'Accept': 'application/json'
    }
}

return byu(requestOptions)
    .then((res) => {
        console.log(res);
    })

NOTE: "aws-ssm" is used to fetch parameters stored in the Amazon Parameter Store. For more information, see http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html and http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SSM.html.

For more information on BYU APIs see https://api.byu.edu/store

Keywords

FAQs

Package last updated on 17 Apr 2018

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