{"id":13588452,"url":"https://github.com/flickr/flickr-sdk","last_synced_at":"2025-04-08T10:19:37.146Z","repository":{"id":8320373,"uuid":"56615764","full_name":"flickr/flickr-sdk","owner":"flickr","description":"Almost certainly the best Flickr API client in the world for node and the browser","archived":false,"fork":false,"pushed_at":"2024-10-09T17:03:08.000Z","size":1170,"stargazers_count":134,"open_issues_count":7,"forks_count":31,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-04-01T08:44:04.121Z","etag":null,"topics":["api","client","flickr","flickr-api","flickr-sdk","javascript","json","oauth","photos","rest","sdk"],"latest_commit_sha":null,"homepage":"https://www.flickr.com/services/api","language":"TypeScript","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/flickr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-04-19T17:03:20.000Z","updated_at":"2025-03-01T13:06:11.000Z","dependencies_parsed_at":"2024-01-11T19:29:28.123Z","dependency_job_id":"7b39199e-fe44-4589-8072-8ccd95f3bc2c","html_url":"https://github.com/flickr/flickr-sdk","commit_stats":{"total_commits":224,"total_committers":17,"mean_commits":"13.176470588235293","dds":0.1830357142857143,"last_synced_commit":"2010939c5b4e9b27b6f57ef0e53d291f2f2d2ef0"},"previous_names":["flickr/flickr"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflickr-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflickr-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflickr-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflickr-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flickr","download_url":"https://codeload.github.com/flickr/flickr-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819940,"owners_count":21001394,"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","client","flickr","flickr-api","flickr-sdk","javascript","json","oauth","photos","rest","sdk"],"created_at":"2024-08-01T15:06:43.451Z","updated_at":"2025-04-08T10:19:37.114Z","avatar_url":"https://github.com/flickr.png","language":"TypeScript","readme":"# flickr-sdk\n\nAlmost certainly the best Flickr API client in the world for node and the browser\n\nThis SDK provides methods and type definitions for all methods listed on https://www.flickr.com/services/api/\n\nTo use this SDK, sign up for an API key [here][api key]\n\n## install\n\n```\n$ npm install flickr-sdk\n```\n\n## quickstart\n\n#### Make a Flickr API call\n\n```js\nimport { createFlickr } from \"flickr-sdk\"\n\nconst { flickr } = createFlickr(\"\u003cyour Flickr API key\u003e\")\n\nconst res = await flickr(\"flickr.photos.getInfo\", {\n    photo_id: '12345',\n})\n```\n\n#### Upload a photo\n\n```js\nimport { createFlickr } from \"flickr-sdk\"\nimport { resolve } from \"node:path\"\n\nconst { upload } = createFlickr({\n    consumerKey: \"\u003cyour API key\u003e\",\n    consumerSecret: \"\u003cyour API secret\u003e\",\n    oauthToken: \"\u003cthe oauth token\u003e\",\n    oauthTokenSecret: \"\u003cthe oauth token secret\u003e\",\n})\n\nconst id = await upload(resolve(\"example.png\"), {\n    title: \"Works on MY machine!\",\n})\n```\n\n## auth\n\nThe Flickr SDK currently supports the following auth methods:\n\n#### API Key\n\nThis is the simplest way to use the SDK. Just provide your API key as a string:\n\n```js\nconst { flickr } = createFlickr(\"\u003cyour API key\u003e\")\n```\n#### OAuth 1.0\n\nOAuth lets users grant your application access and then you may act on their\nbehalf. The OAuth flow is described [here][oauth].\n\n```js\nconst { upload } = createFlickr({\n    consumerKey: \"\u003cyour API key\u003e\",\n    consumerSecret: \"\u003cyour API secret\u003e\",\n    oauthToken: \"\u003cthe oauth token\u003e\",\n    oauthTokenSecret: \"\u003cthe oauth token secret\u003e\",\n})\n```\n\n\u003e 💡 Use `examples/oauth.mjs` to quickly set up an OAuth flow and obtain a\n\u003e set of credentials\n\n## migrating from previous versions\n\nPrevious versions of this SDK depended on [superagent][superagent] for http\nrequests. This version of the SDK uses node's native `fetch` instead, so you now\nonly receive the response body back from an API call. This means **the return\nvalue of an API call will only be the response body, not a superagent Request**\n\nMigrating existing code looks like this:\n\n```js\n//  old\nconst res = await flickr.test.login()\nconsole.log(res.body)\n\n// new\nconst body = await flickr('flickr.test.login', {})\nconsole.log(body)\n```\n\n## advanced\n\n#### configuring fetch\n\n```js\nimport { createFlickr, FetchTransport } from 'flickr-sdk'\n\nconst transport = new FetchTransport({\n    headers: {\n        'user-agent': 'foo',\n    }\n})\n\nconst { flickr } = createFlickr('\u003cyour API key\u003e', transport)\n```\n\n#### testing\n\n```js\nimport { createFlickr, MockTransport, NullAuth } from 'flickr-sdk'\nimport * as assert from 'node:assert'\n\n// mock transport returns the response you pass in the constructor\nconst transport = new MockTransport({\n    stat: 'ok',\n    foo: 'bar'\n})\n\n// null auth does nothing\nconst auth = NullAuth()\n\nconst { flickr } = createFlickr(auth, transport)\n\n// makes no network request\nconst res = await flickr('flickr.photos.getInfo', {\n    photo_id: '12345',\n})\n\nassert.deepStrictEqual(res, { stat: 'ok', foo: 'bar' })\n```\n\n[api key]: https://www.flickr.com/services/apps/create/\n[oauth]: https://www.flickr.com/services/api/auth.oauth.html\n[superagent]: https://github.com/ladjs/superagent/\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflickr%2Fflickr-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflickr%2Fflickr-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflickr%2Fflickr-sdk/lists"}