{"_id":"@artsy/artsy-xapp","_rev":"16-5ad84101f2ae18c507dd489a20f567ff","name":"@artsy/artsy-xapp","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@artsy/artsy-xapp","version":"1.0.4","keywords":["artsy","xapp"],"author":{"name":"Craig Spaeth"},"license":"MIT","_id":"@artsy/artsy-xapp@1.0.4","maintainers":[{"name":"alloy","email":"eloy.de.enige@gmail.com"},{"name":"zephraph","email":"zephraph@gmail.com"},{"name":"arjelks","email":"ashley.jelks@artsymail.com"},{"name":"artsy-engineering","email":"opensource@artsymail.com"},{"name":"erikdstock","email":"erik.d.stock@gmail.com"},{"name":"xtina-starr","email":"c.thompsonms@gmail.com"},{"name":"l2succes","email":"l2succes@gmail.com"},{"name":"damassi","email":"damassi.pappas@gmail.com"},{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},{"name":"yuki24","email":"yk.nishijima@gmail.com"},{"name":"orta","email":"orta.therox@gmail.com"},{"name":"mzikherman","email":"mzikherman@gmail.com"},{"name":"oxaudo","email":"oxaudo@yahoo.com"},{"name":"eessex","email":"eve@artsymail.com"}],"homepage":"https://github.com/artsy/artsy-xapp","bugs":{"url":"https://github.com/artsy/artsy-xapp/issues"},"dist":{"shasum":"35fc7b9d43898f99c8629737900cf7d4ba420f16","tarball":"https://registry.npmjs.org/@artsy/artsy-xapp/-/artsy-xapp-1.0.4.tgz","fileCount":5,"integrity":"sha512-sh4XYWTSSWKHPHyeduuRndtzJYQXihoomeWgxpnvAxMtqvw7er4uuSXf/uP3fLI6FoBsGd5zz+N6qMmaeK20UA==","signatures":[{"sig":"MEUCICHAttz4jEiEzMi4l6yTvdcSgPJj0E369v6AEQ+0vH0NAiEA1PlJ3EcHxHNmdAEmwC1VROMwx3d3K6vvhiyFdAlUlMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/sJeCRA9TVsSAnZWagAAYfMP/2rOc4hSoNnB5Y/xkO1b\n2S6pViCi9L2zUZ/yfiy5Apc3jrMvuUCpUVuFGQCkQ6G9V0RDS+6G7I6sd38Z\n+2J3302yd519yhGUMXkK12pKXHVRFmYD7L4IW49cIuQmVETSemD3P8Qr/JZN\nKJt444K0E5ZdsLK+OVoicQFa6y7uzXr1DZl7wpxZGOVCxopBzB977YBIkNd/\nRM0T0sln1TyI1bMfjy49IMBkE6Meeghu+Qag3GYDA68IgqRitT/WZ5Tfv6xa\nbbq9YeCRGkD0Kw2jgbTwzDjAZroDaT8nnxMs46FhEkdbVUaMdOdFwjEZoKrv\n989tiqzHJiREUWgW/fIU9lDVzIe59093f76i8ryTs+1NNFG/OuHW9ajz0uZ4\nDz8YUCrjx194DMiPDvs0WI4wHBQuc1c3CwLRFJ3oKXbonqLt1Cw1PDuhg9la\njCKpi0xRQU9xlxjjohPwGy8CxpHTUjO3KTCC2otn/86kHyLicipE3/nBEIqK\nddih1wncbdn3vGh+sHtDpvOc0cUnsf0xw9qXj4fH9TGFXfrbpWsNe2zNKcAz\n0h8hGOYHu+zkkgyblVvL35lMSaqZaXrcpQL1QtZGJJUGuf53CXp/DbEPo0Pq\nfVrJU6bolfP/rxIXO0QzXvt/dVkUdgnhjv8yASI2M9y10/BPvqtNTVSh5Nmf\n1i3l\r\n=/zfv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"6dcf1192e8ea599c64fb49651a7b1f249658a865","scripts":{"test":"NODE_ENV=staging mocha -r should"},"_npmUser":{"name":"mzikherman","email":"mzikherman@gmail.com"},"repository":{"url":"git+https://github.com/artsy/artsy-xapp.git","type":"git"},"_npmVersion":"6.4.1","description":"Tiny lib to fetch and refresh an xapp token from Artsy's API.","directories":{},"_nodeVersion":"10.13.0","dependencies":{"superagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.2.4","should":"^6.0.1","express":"^4.12.3"},"_npmOperationalInternal":{"tmp":"tmp/artsy-xapp_1.0.4_1560199773687_0.8629128441101206","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-06-10T20:49:33.567Z","modified":"2025-11-18T23:31:22.552Z","1.0.4":"2019-06-10T20:49:33.814Z"},"bugs":{"url":"https://github.com/artsy/artsy-xapp/issues"},"author":{"name":"Craig Spaeth"},"license":"MIT","homepage":"https://github.com/artsy/artsy-xapp","keywords":["artsy","xapp"],"repository":{"url":"git+https://github.com/artsy/artsy-xapp.git","type":"git"},"description":"Tiny lib to fetch and refresh an xapp token from Artsy's API.","maintainers":[{"email":"opensource@artsymail.com","name":"artsy-engineering"},{"email":"anandaroop.roy+npm@gmail.com","name":"anandaroop"},{"email":"mzikherman@gmail.com","name":"mzikherman"},{"email":"dblandin@gmail.com","name":"dblandin"},{"email":"joey@artsymail.com","name":"joeyaghion"}],"readme":"# artsy-xapp\nTiny lib to fetch, store, and refresh an xapp token from Artsy's API.\n\n## Example\n\n````javascript\nvar artsyXapp = require('artsy-xapp');\nartsyXapp.init({\n  url: 'https://api.artsy.net', // defaults to process.env.ARTSY_URL\n  id: '31f31ffds', // defaults to process.env.ARTSY_ID\n  secret: '32rf1fds' // defaults to process.env.ARTSY_SECRET\n}, function() {\n  app.locals.xappToken = artsyXapp.token\n});\nartsyXapp.on('error', process.exit);\n````\n\n## How it works\n\nArtsyXapp 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.\n\n## License\n\nMIT","readmeFilename":"README.md"}