Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit f2062e6

Browse files
authored
Use Cache for credentials
Sets the cache to use when persisting credentials
1 parent 45297bd commit f2062e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

samples/Twitter.gs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ function getService() {
4949
// Set the name of the callback function in the script referenced
5050
// above that should be invoked to complete the OAuth flow.
5151
.setCallbackFunction('authCallback')
52+
53+
// Using a cache will reduce the need to read from
54+
// the property store and may increase performance.
55+
.setCache(CacheService.getUserCache())
5256

5357
// Set the property store where authorized tokens should be persisted.
5458
.setPropertyStore(PropertiesService.getUserProperties());

0 commit comments

Comments
 (0)