{"_id":"@ascensionlabs/evesso","name":"@ascensionlabs/evesso","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ascensionlabs/evesso","version":"1.0.0","description":"Library for Eve Online SSO Authentication via PCKE flow","license":"AGPL-3.0-or-later","author":{"name":"Ascension Labs"},"type":"module","main":"index.js","keywords":["eve","eve online","sso","esi"],"dependencies":{"form-urlencoded":"^6.1.5","jsonwebtoken":"^9.0.2","jwks-rsa":"^3.2.0"},"gitHead":"fa2bf7e8743d9515581940529eab9dbb49fb797f","_id":"@ascensionlabs/evesso@1.0.0","_nodeVersion":"22.16.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-FfOJnLzWVEyqVNdwkCgFDRaqJLqhE61Ij1Ty5acigADq/Ld+mG1y4SB7AjUBUKK6Ms7Bs4h6Wb8R0fHnClqvYQ==","shasum":"174a5cc0166c593cb315d4d73daa3888bed3403a","tarball":"https://registry.npmjs.org/@ascensionlabs/evesso/-/evesso-1.0.0.tgz","fileCount":7,"unpackedSize":16200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC2WpDNRc5MA/0ONg48t1VdxGVJJfEBbyvIZJ/XzwRckAIhAONZaqV63f1C67zCbh2q1DhIqDBXXj7jenNmcfm/nKCU"}]},"_npmUser":{"name":"ascensionlabs","email":"holydaimon@proton.me"},"directories":{},"maintainers":[{"name":"ascensionlabs","email":"holydaimon@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/evesso_1.0.0_1783006069734_0.5089148018652219"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-02T15:27:49.548Z","1.0.0":"2026-07-02T15:27:50.028Z","modified":"2026-07-02T15:27:50.195Z"},"maintainers":[{"name":"ascensionlabs","email":"holydaimon@proton.me"}],"description":"Library for Eve Online SSO Authentication via PCKE flow","keywords":["eve","eve online","sso","esi"],"author":{"name":"Ascension Labs"},"license":"AGPL-3.0-or-later","readme":"# EVESSO\r\n\r\nLibrary for Eve Online SSO Authentication via PCKE flow.\r\n\r\n### Installation\r\n\r\n`npm install @ascensionlabs/evesso`\r\n\r\n### Character Storage\r\n\r\nWhen authenticating a character you will want to save the details so the user does not have to login every time they use your app. For this reason, evesso ships with a simple file backed character store that is used if you do not provide your own. You can provide an object with functions matching the character store interface to load/save the character another way. See the jsdoc comments in the code for more info.\r\n\r\n### Authentication\r\n\r\nThe exact details depend on your environment node/express, electron, etc.\r\n\r\n*semi-psuedo-code*\r\n```\r\nimport { EveSSO } from '@ascensionlabs/evesso'\r\n\r\n// to get your esiConfig data, create your app at https://developers.eveonline.com/applications\r\nconst esiConfig = {\r\n    clientId: 'your-client-id',\r\n    callbackUrl: 'https://yourcallback.app/url',\r\n    userAgent: 'your-user-agent'\r\n    scopes: [\r\n        // requesting two permissions/scopes\r\n        // they must be allowed in your app config\r\n        'esi-location.read_online.v1',\r\n        'esi-location.read_location.v1',\r\n    ]\r\n}\r\nconst sso = new EveSSO(esiConfig, options)\r\n\r\n// builds redirect url from your esiConfig\r\n// direct user to this url, they login normally\r\n// and get redirected to the esiConfig.callbackUrl\r\nconst redirectUrl = sso.redirectUrl()\r\n\r\n// Use this handler for redirects to your callbackUrl, it validates the login request\r\n// and calls the callback with esiInfo on success; if an error occurs it will be thrown.\r\n// When login is successful `charStore.storeCharacter` will be called with esiInfo obtained.\r\n// The default character store will write the esiInfo to ./esi/{charId}.json\r\nsso.redirect(url, esiInfo => { console.log('succes', { esiInfo }) })\r\n    .catch(error => { console.error('failed', { error }) })\r\n```\r\n\r\nFor more info on Eve's Single Sign-On check out the official docs.\r\n\r\nhttps://developers.eveonline.com/docs/services/sso/#authorization-code-with-pkce\r\n\r\n# ESI Requests\r\n\r\n```\r\n// request public data\r\n// no authentication required\r\nconst charInfo = await sso.getESI('/characters/180548812')\r\n\r\n// request authenticated data and handle errors\r\n// requires charId that has been authenticated with proper scope\r\nsso.getESI('/corporations/109299958/wallets', charId)\r\n    .then(data => console.log('success', data))\r\n    .catch(error => console.error('failed', error))\r\n\r\n// send a POST/PUT/DELETE - the third parameter is the options passed to fetch\r\nsso.getESI(`/characters/${charId}/fittings/`, charId, { method: 'POST', body: JSON.stringify(yourFitting) })\r\n    .then(data => console.log('success', data))\r\n    .catch(error => console.error('failed', error))\r\n```\r\n\r\n### Token Refresh\r\n\r\n`getESI` will seamlessly refresh the access token if it expires making this process transparent.\r\n\r\nIf the token fails to refresh the character is set to inactive via `charStore.deactivateCharacter`.\r\n\r\n\r\n\r\n","readmeFilename":"README.md","_rev":"1-ccf23d34399bc93d4fde0e8154f83ffc"}