{"id":22903954,"url":"https://github.com/json2d/gapi-nano","last_synced_at":"2025-10-10T05:14:51.838Z","repository":{"id":95070235,"uuid":"84501637","full_name":"json2d/gapi-nano","owner":"json2d","description":"a wrapper for Google API Client Library for using Google Apps Script REST Execution API","archived":false,"fork":false,"pushed_at":"2017-03-18T21:21:52.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T04:39:02.949Z","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/json2d.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,"zenodo":null}},"created_at":"2017-03-10T00:26:21.000Z","updated_at":"2017-03-10T00:26:31.000Z","dependencies_parsed_at":"2023-03-26T16:50:02.353Z","dependency_job_id":null,"html_url":"https://github.com/json2d/gapi-nano","commit_stats":null,"previous_names":["bitstrider/gapi-nano"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/json2d/gapi-nano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fgapi-nano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fgapi-nano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fgapi-nano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fgapi-nano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json2d","download_url":"https://codeload.github.com/json2d/gapi-nano/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fgapi-nano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002799,"owners_count":26083468,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-14T02:39:34.304Z","updated_at":"2025-10-10T05:14:51.832Z","avatar_url":"https://github.com/json2d.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Summary\nThis is a wrapper for the \u003cb\u003eGoogle API Client Library\u003c/b\u003e, providing opinionated syntactic sugar for client authentication and making requests to a \u003cb\u003eGoogle Apps Script\u003c/b\u003e via the \u003cb\u003eREST Execution API\u003c/b\u003e\n\nSee: https://developers.google.com/apps-script/guides/rest/quickstart/js\n\n## Basic Usage\nIn your html, include the browser build `gapi-nano.js` from the `dist` directory after `https://apis.google.com/js/api.js`\n\n```html\n\u003cscript src=\"https://apis.google.com/js/api.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"/dist/gapi-nano.js\"\u003e\u003c/script\u003e\n```\n\nThen in another script below that, pass in some options to `gapiNano.init` to get started\n\n```html\n\u003cscript\u003e\n  var options = {\n    clientId: '[CLOUD PLATFORM CLIENT_ID]',\n    discoveryDocs: [\"https://script.googleapis.com/$discovery/rest?version=v1\"],\n    scope: '[SCOPE]',\n    scriptId: '[SCRIPT_ID]'\n  }\n\n  gapiNano.init(options,function(signedIn){\n    console.log(\"User signed in?\", signedIn)\n\n    gapiNano.run('sum',{a:1,b:2}).then(function(result){\n      console.log('sum of 1 and 2 is', result)\n    })\n\n  })\n\u003c/script\u003e\n```\n\n## Functions\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#init\"\u003einit(options, authListener)\u003c/a\u003e ⇒ \u003ccode\u003eundefined\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003einit - loads and authenticates gapi client using Auth2\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#run\"\u003erun(fName, parameters)\u003c/a\u003e ⇒ \u003ccode\u003ePromise\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003erun - calls a function from the script specified by scriptId option during init()\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"init\"\u003e\u003c/a\u003e\n\n## init(options, authListener) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n`gapiNano.init` - loads and authenticates gapi client using Auth2\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eobject\u003c/code\u003e | Auth2 options, including clientId and scope |\n| authListener | \u003ccode\u003efunction\u003c/code\u003e | (optional) callback with a single boolean parameter, called whenever the authentication status changes |\n\n\u003ca name=\"run\"\u003e\u003c/a\u003e\n\n## run(fName, parameters) ⇒ \u003ccode\u003ePromise\u003c/code\u003e\n`gapiNano.run` - calls a function from the script specified by scriptId option during init()\n\n**Returns**: \u003ccode\u003ePromise\u003c/code\u003e - a Promise object resolved with result of the function call  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fName | \u003ccode\u003estring\u003c/code\u003e | the name of the function |\n| parameters | \u003ccode\u003eobject\u003c/code\u003e | (optional) the arguments passed to the function |\n\n\n## Building Changes\nTo rebuild `dist/gapi-nano.js` from `index.js`, use the npm task:\n```\n$ npm run dist\n```\nOf course this requires `browserify` to be installed globally:\n```\n$ npm install -g browserify\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fgapi-nano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson2d%2Fgapi-nano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fgapi-nano/lists"}