{"id":28089158,"url":"https://github.com/james-firth/kanka-js","last_synced_at":"2025-05-13T12:54:20.512Z","repository":{"id":57288249,"uuid":"150974804","full_name":"James-Firth/kanka-js","owner":"James-Firth","description":"A Javascript wrapper for the Kanka.io API. ","archived":false,"fork":false,"pushed_at":"2023-10-03T22:27:49.000Z","size":22,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-05-09T06:48:39.529Z","etag":null,"topics":["api-wrapper","async-await","javascript","js","kanka"],"latest_commit_sha":null,"homepage":"https://github.com/James-Firth/kanka-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/James-Firth.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}},"created_at":"2018-09-30T14:33:55.000Z","updated_at":"2023-10-03T22:27:00.000Z","dependencies_parsed_at":"2022-08-24T22:00:49.220Z","dependency_job_id":null,"html_url":"https://github.com/James-Firth/kanka-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-Firth%2Fkanka-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-Firth%2Fkanka-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-Firth%2Fkanka-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James-Firth%2Fkanka-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/James-Firth","download_url":"https://codeload.github.com/James-Firth/kanka-js/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948328,"owners_count":21988953,"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":["api-wrapper","async-await","javascript","js","kanka"],"created_at":"2025-05-13T12:54:19.758Z","updated_at":"2025-05-13T12:54:20.494Z","avatar_url":"https://github.com/James-Firth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kanka JS\n\n:warning: **OUT OF DATE/DEPRECATION WARNING:** I haven't had a chance to work with this for a long time now and there have been _many_ changes. Considering using this as inspiration for your own library instead of using it directly!\n\n---\n\nA wrapper for the Kanka API written in javascript. \n\n\nThis wrapper works with both async/await and Promises.\n\n```js\nconst kanka = require('kanka');\n\n// First set your API token.\n// Alternatively export the environmental variable KANKA_TOKEN=\"myToken\"\nconst token = 'myAPIToken';\nkanka.setToken(token);\n\n// Grab an individual campaign, or list all of them.\n// NOTE: If you have a lot of campaigns (over 45) this version not work for you as I haven't implemented pagination.\n\nasync function runExample(){\n    console.log(\"Start\");\n    try {\n        let campaignList = await kanka.listCampaigns();\n        // Some types come back as Pages. For those types look at the data key\n        let campaignNames = campaignList.data.map(x =\u003e `\"${x.name}\"`);\n        console.log(`Campaign Names: ${campaignNames}\\n`);\n\n        let camp = await kanka.getCampaign(campaignList.data[0].id);\n        console.log(`Looking at Campaign: \"${camp.name}\"\\n`);\n\n        let characters = await camp.characters.get();\n        console.log(`Characters: ${characters.map(x =\u003e ' '+x.name)}\\n`);\n\n        let person = await camp.characters.get(characters[0].id);\n        let attributes = await person.attributes.get();\n        console.log(`Attributes for ${person.name}: ${attributes.map(x =\u003e x.name+': '+x.value+'\\n')}\\n`);\n\n\n        let relations = await person.relations.get();\n        console.log(`Relations for ${person.name}: ${relations}\\n`);\n\n        let notes = await person.notes.get();\n        console.log(`Notes for ${person.name}: ${notes}\\n`);\n\n        let calendar = await camp.calendars.get();\n        console.log(`Calendars: ${calendar.map(x =\u003e ' '+x.name)}\\n`);\n\n        let events = await camp.events.get();\n        console.log(`Events: ${events.map(x =\u003e ' '+x.name)}\\n`);\n\n    } catch(e) {\n        throw e;\n    }\n}\n\nrunExample();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-firth%2Fkanka-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames-firth%2Fkanka-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-firth%2Fkanka-js/lists"}