{"id":19580874,"url":"https://github.com/orcid/orcid-js","last_synced_at":"2025-04-27T09:32:45.055Z","repository":{"id":142001978,"uuid":"43549932","full_name":"ORCID/orcid-js","owner":"ORCID","description":"A general purpose ORCID javascript client and reference list generator, supporting CSL, citeproc-JSON and bibtex","archived":false,"fork":false,"pushed_at":"2017-12-13T15:55:05.000Z","size":166,"stargazers_count":22,"open_issues_count":5,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T23:33:11.282Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ORCID.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"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-02T11:46:15.000Z","updated_at":"2025-03-04T21:21:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1f6ac58-4428-4771-b481-94fd6ebfb553","html_url":"https://github.com/ORCID/orcid-js","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/ORCID%2Forcid-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORCID%2Forcid-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORCID%2Forcid-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORCID%2Forcid-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ORCID","download_url":"https://codeload.github.com/ORCID/orcid-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251118788,"owners_count":21539189,"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-11-11T07:30:39.729Z","updated_at":"2025-04-27T09:32:45.047Z","avatar_url":"https://github.com/ORCID.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ORCID-JS\n========\n\nA client side reference list generator for ORCID records\n--------------------------------------------------------\n\nThis library can be used to generate on the fly reference lists from ORCID records.  It also exposes the entire [V2.0_rc1 Public ORCID API](https://pub.orcid.org/v2.0_rc1) via a swagger client (including the stats API).  It can be used to generate any CSL style, Citeproc-JSON or bibtex.\n\nHello world example\n-------------------\n```javascript\n\t//write a reference list to the page in the default style (chicago)\n\t//fetches citations asynchronously, so order is not guarenteed\n\torcid.init(function(){\n\t\torcid.resolveCitations(\"0000-0003-0902-4386\", function(citations, failures){\n\t\t\tfor (c in citations){\n\t\t\t\t$(\"body\").append(citations[c] +\"\u003cbr/\u003e\");\t\n\t\t\t}\n\t\t\tfor (f in failures){\n\t\t\t\t$(\"body\").append(failures[f].title + \" (\" + failures[f].citeprocURL+\") FAILED to fetch metadata\u003cbr/\u003e\");\t\t\n\t\t\t}\n\t\t});\t\t\n\t});\n```\n\nViewing the examples locally\n----------------------------\nChrome and Firefox will prevent the browser from loading other resources from the file system.  To test locally, you need to server the files from a webserver.  This can easily be done using python.  Run the following command:\n\n```\npython -m SimpleHTTPServer\n```\n\nThen access the example at http://localhost:8000/example.html\n\nWhere does the metadata come from?\n-----\nTo generate citations, the library does the following:\n\n*\tObtain a public list of activites from an ORCID record\n*\tFor each work fetch authoritative citation metadata available using the **prefered source**\n*  For works with DOIs, citeproc metadata is obtained directly from Crossref or Datacite\n*  For other works, citeproc is obtained from the ORCID registry.  If there is a BibTeX citation, this is transformed into Citeproc-JSON, otherwise ORCID work metadata is used\n*\tFor each work, attempt to create a URL based on the idenfifier\n*\tApply a [CSL citation style](http://citationstyles.org/) to generate reference list or BibTeX\n\nAs other services add the ability to resolve citeproc metadata, this tool will be updated to use it.\n\nUsage\n-----\nThe most useful method has this signature:\n\n\tfunction resolveCitationsFromORCIDID(orcidID, callback, oneByOne, optionalCitationStyle, returnCiteprocObjects)\n\nThere is also an [example.html](https://github.com/TomDemeranville/orcid-js/blob/master/example.html) page\n\n```javascript\n\torcid.init(callback);\n\tfunction callback(){\n\t\t//to fetch asyncronously and have the callback called once for each citation (recommended) use:\n\t\torcid.resolveCitations(\"0000-0000-0000-0000\", onCompleteCallback, true);\n\t\t//to get the citations an array of citation strings via a callback as a batch use:\n\t\torcid.resolveCitations(\"0000-0000-0000-0000\", onCompleteCallback, false);\n\t\t// the default style is Chicago, we can ask for bibtex instead like this:\n\t\torcid.resolveCitations(\"0000-0000-0000-0000\", onCompleteCallback, false, orcid.styleBibtex);\n\t\t// if you want an array of citeproc JSON objects instead, use this:\n\t\torcid.resolveCitations(\"0000-0000-0000-0000\", onCompleteCallback, true, \"\", true);\t\n\t}\n\n\t//If all you need is a list of titles, identifiers and URLS, use simpleWorks\n\t//This also demonstrates how to access the API via swagger (full v2.0 api is supported)\n\torcid.init(callback);\n\tfunction callback(){\n\t\torcid.client.apis[\"Public API v2.0_rc1\"].viewActivities({orcid:\"0000-0000-0000-0000\"}, function(data) {\n\t\t\tvar simpleWorks = orcid.activitiesToSimpleWorks(data);\n\t\t\t//do whatever with the simpleWorks\n\t\t});\n\t}\n```\n\nIf you would like to load a citation format that is not supplied by default (APA, Chicago, Bibtex) then use the styles.js helper to fetch it from the server.  All the styles in the style repo should be available.  Something like this:\n\n```javascript\n\tCSLStyles.fetchStyleXML(\"academy-of-management-review\", function(styleXML){\n\t\torcid.resolveCitations(orcidID, updatePage, true, styleXML);\t\t\n\t});\n```\n\nDependencies\n------------\nswagger-client.js, jquery, citeproc-js \ntransitive: xmle4x.js,xmldom.js\n\nWhen cloning this repository, you must run\n```\ngit submodule init\ngit submodule update\n```\nTo fetch the dependancies\n\nIssues\n------\nChrome always logs the following to the console:\n\n\txmle4x.js:11 Uncaught SyntaxError: Unexpected token default\n\nThis is a citeproc dependency used by legacy browsers and does not affect function in Chrome/Firefox.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forcid%2Forcid-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forcid%2Forcid-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forcid%2Forcid-js/lists"}