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

@artsy/artsy-xapp

Package Overview
Dependencies
Maintainers
14
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@artsy/artsy-xapp

Tiny lib to fetch and refresh an xapp token from Artsy's API.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

artsy-xapp

Tiny lib to fetch, store, and refresh an xapp token from Artsy's API.

Example

var artsyXapp = require('artsy-xapp');
artsyXapp.init({
  url: 'https://api.artsy.net', // defaults to process.env.ARTSY_URL
  id: '31f31ffds', // defaults to process.env.ARTSY_ID
  secret: '32rf1fds' // defaults to process.env.ARTSY_SECRET
}, function() {
  app.locals.xappToken = artsyXapp.token
});
artsyXapp.on('error', process.exit);

How it works

ArtsyXapp will fetch an xapp token on init, store the token in artsyXapp.token and refresh the token in the background. If everything goes to hell (e.g. the token is expiring and Artsy's API is down) it will emit an error and null the token—you probably want to crash the server at this point if your app depends deeply on Artsy's API.

License

MIT

Keywords

FAQs

Package last updated on 10 Jun 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

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