Skip to content

Commit b4b2df7

Browse files
author
Eric Koleda
committed
Use ScriptApp.getProjectKey() to automatically determine the project key.
Deprecate Service.setProjectKey() and remove it from the README.
1 parent 3e1288a commit b4b2df7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ service for the Google Drive API.
6363
.setClientId('...')
6464
.setClientSecret('...')
6565

66-
// Set the project key of the script using this library.
67-
.setProjectKey('...')
68-
6966
// Set the name of the callback function in the script referenced
7067
// above that should be invoked to complete the OAuth flow.
7168
.setCallbackFunction('authCallback')

Service.gs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var Service_ = function(serviceName) {
2929
this.params_ = {};
3030
this.tokenFormat_ = TOKEN_FORMAT.JSON;
3131
this.tokenHeaders_ = null;
32+
this.projectKey_ = ScriptApp.getProjectKey();
3233
};
3334

3435
/**
@@ -86,6 +87,7 @@ Service_.prototype.setTokenHeaders = function(tokenHeaders) {
8687
* The project key can be found in the Script Editor UI under "File > Project properties".
8788
* @param {string} projectKey The project key of the project containing the callback function.
8889
* @return {Service_} This service, for chaining.
90+
* @deprecated The project key is now be determined automatically.
8991
*/
9092
Service_.prototype.setProjectKey = function(projectKey) {
9193
this.projectKey_ = projectKey;

0 commit comments

Comments
 (0)