{"id":13602729,"url":"https://github.com/Medium/medium-sdk-nodejs","last_synced_at":"2025-04-11T09:30:50.538Z","repository":{"id":45037148,"uuid":"43842350","full_name":"Medium/medium-sdk-nodejs","owner":"Medium","description":"A NodeJS SDK for Medium's OAuth2 API https://medium.com","archived":false,"fork":false,"pushed_at":"2024-02-25T18:35:53.000Z","size":23,"stargazers_count":347,"open_issues_count":10,"forks_count":34,"subscribers_count":112,"default_branch":"master","last_synced_at":"2025-04-08T04:14:55.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Medium.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}},"created_at":"2015-10-07T20:16:22.000Z","updated_at":"2025-03-02T11:51:16.000Z","dependencies_parsed_at":"2024-01-16T22:21:16.802Z","dependency_job_id":"5c15a0d5-14b7-4b68-930e-d8f5ce5a2cc2","html_url":"https://github.com/Medium/medium-sdk-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Medium%2Fmedium-sdk-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Medium%2Fmedium-sdk-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Medium%2Fmedium-sdk-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Medium%2Fmedium-sdk-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Medium","download_url":"https://codeload.github.com/Medium/medium-sdk-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"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":[],"created_at":"2024-08-01T18:01:35.995Z","updated_at":"2025-04-11T09:30:50.508Z","avatar_url":"https://github.com/Medium.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"**Warning:** This sdk is no longer supported or maintained by Medium.\n\n\n# Medium SDK for NodeJS\n\nThis repository contains the open source SDK for integrating [Medium](https://medium.com)'s OAuth2 API into your NodeJs app.\n\nView the full [documentation here](https://github.com/Medium/medium-api-docs).\n\nInstall\n-------\n\n    npm install medium-sdk\n\nUsage\n-----\n\nCreate a client, then call commands on it.\n\n```javascript\nvar medium = require('medium-sdk')\n\nvar client = new medium.MediumClient({\n  clientId: 'YOUR_CLIENT_ID',\n  clientSecret: 'YOUR_CLIENT_SECRET'\n})\n\nvar redirectURL = 'https://yoursite.com/callback/medium'; \n\nvar url = client.getAuthorizationUrl('secretState', redirectURL, [\n  medium.Scope.BASIC_PROFILE, medium.Scope.PUBLISH_POST\n])\n\n// (Send the user to the authorization URL to obtain an authorization code.)\n\nclient.exchangeAuthorizationCode('YOUR_AUTHORIZATION_CODE', redirectURL, function (err, token) {\n  client.getUser(function (err, user) {\n    client.createPost({\n      userId: user.id,\n      title: 'A new post',\n      contentFormat: medium.PostContentFormat.HTML,\n      content: '\u003ch1\u003eA New Post\u003c/h1\u003e\u003cp\u003eThis is my new post.\u003c/p\u003e',\n      publishStatus: medium.PostPublishStatus.DRAFT\n    }, function (err, post) {\n      console.log(token, user, post)\n    })\n  })\n})\n```\n\nContributing\n------------\n\nQuestions, comments, bug reports, and pull requests are all welcomed. If you haven't contributed to a Medium project before please head over to the [Open Source Project](https://github.com/Medium/opensource#note-to-external-contributors) and fill out an OCLA (it should be pretty painless).\n\nAuthors\n-------\n\n[Jamie Talbot](https://github.com/majelbstoat)\n\nLicense\n-------\n\nCopyright 2015 [A Medium Corporation](https://medium.com)\n\nLicensed under Apache License Version 2.0.  Details in the attached LICENSE\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMedium%2Fmedium-sdk-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMedium%2Fmedium-sdk-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMedium%2Fmedium-sdk-nodejs/lists"}