{"id":28477485,"url":"https://github.com/magicoflolis/aidungeon.js","last_synced_at":"2025-06-30T08:31:31.353Z","repository":{"id":296298296,"uuid":"992881540","full_name":"magicoflolis/aidungeon.js","owner":"magicoflolis","description":"Edit AI Dungeon scenarios in your favorite editor and upload changes.","archived":false,"fork":false,"pushed_at":"2025-06-21T15:33:09.000Z","size":53,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T00:50:04.921Z","etag":null,"topics":["ai","aidungeon","dungeon","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/aidungeon.js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicoflolis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-29T21:27:10.000Z","updated_at":"2025-06-21T15:33:12.000Z","dependencies_parsed_at":"2025-05-29T23:39:12.550Z","dependency_job_id":"b836c179-951c-4c9c-bbc1-afeafa5c581b","html_url":"https://github.com/magicoflolis/aidungeon.js","commit_stats":null,"previous_names":["magicoflolis/aidungeon.js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/magicoflolis/aidungeon.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicoflolis%2Faidungeon.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicoflolis%2Faidungeon.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicoflolis%2Faidungeon.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicoflolis%2Faidungeon.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicoflolis","download_url":"https://codeload.github.com/magicoflolis/aidungeon.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicoflolis%2Faidungeon.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262738934,"owners_count":23356614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","aidungeon","dungeon","npm-package"],"created_at":"2025-06-07T16:36:25.239Z","updated_at":"2025-06-30T08:31:31.322Z","avatar_url":"https://github.com/magicoflolis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aidungeon.js\n\nEdit AI Dungeon scenarios in your favorite editor and upload changes.\n\n## **Features**\n\n- Build + minimize scenario scripts to local disk, default folder `./dist`.\n- Update *multiple* scenarios.\n- Supports common AI Dungeon GraphQL queries.\n- Supports custom GraphQL queries.\n\n## Pre-requirements\n\n- [Node.js](https://nodejs.org/) + basic understanding of Node.JS and `package.json` workspaces\n- Access to your [Firebase token](#getting-your-firebase-token)\n\n## **Install**\n\n**npm:**\n\n```bash\nnpm install aidungeon.js\n```\n\n**pnpm:**\n\n```bash\npnpm add aidungeon.js\n```\n\n### Getting Your Firebase Token\n\n\u003e Tokens will expire after `x` amount of time\n\n**DevTools (recommended):**\n\n- Open your web browsers DevTools, `Ctrl` + `Shift` + `I`\n- Navigate to the `console` tab\n- Copy n paste the code below into the console and hit `Enter`\n- The console will print: `AID_TOKEN=\"Your Token\"`\n- Repeat steps to refresh your token\n\n```js filename=\"tests/browser.js\"\n(async () =\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    if (typeof indexedDB !== 'undefined') {\n      const dbReq = indexedDB.open('firebaseLocalStorageDb');\n      dbReq.onerror = reject;\n      dbReq.onsuccess = (event) =\u003e {\n        const transaction = event.target.result.transaction(['firebaseLocalStorage'], 'readwrite');\n        const objectStore = transaction.objectStore('firebaseLocalStorage');\n        const allKeys = objectStore.getAllKeys();\n        allKeys.onerror = reject;\n        allKeys.onsuccess = (evt) =\u003e {\n          const key = evt.target.result.find((r) =\u003e r.includes('firebase:authUser:'));\n          objectStore.get(key).onsuccess = (evt) =\u003e {\n            const { value } = evt.target.result;\n            resolve(`AID_TOKEN=\"${value.stsTokenManager.accessToken}\"`);\n          };\n        };\n      };\n    } else {\n      reject(new Error('indexedDB is not defined.'));\n    }\n  });\n})()\n  .then(console.log)\n  .catch(console.error);\n```\n\n**Bookmarklet (not recommended):**\n\n- Save this URL as a bookmark, clicking it will cause the file to inject itself into the current webpage.\n  - Does not work on all browsers\n- Open your web browsers DevTools, `Ctrl` + `Shift` + `I`\n- Navigate to the `console` tab\n- The console will print: `AID_TOKEN=\"Your Token\"`\n- Repeat steps to refresh your token\n\n```js filename=\"tests/browser.js\"\njavascript:(function(){['https://cdn.jsdelivr.net/gh/magicoflolis/aidungeon.js@master/tests/browser.js'].map(s=\u003edocument.body.appendChild(document.createElement('script')).src=s)})();\n```\n\n### Example Setup\n\n\u003e See [upload.js](https://github.com/magicoflolis/aidungeon.js/tree/main/tests/upload)\n\n### TODO\n\n- Add better examples\n- Support custom queries\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicoflolis%2Faidungeon.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicoflolis%2Faidungeon.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicoflolis%2Faidungeon.js/lists"}