You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Allow passing in a token
Changes to allow the token info to be retrieved and set on the API
client. This is useful when running across multiple servers or when
running in a serverless environment.
Closes#70
* Fix ESLint errors
* Fix spacing
* Update examples in README
@@ -36,6 +34,7 @@ See the [NodeJS Release Page](https://github.com/nodejs/release) for info on thi
36
34
If you don't already have an API key, fill out and submit the [contact form](http://engage.gettyimages.com/api-contact) to be connected to our Sales team.
37
35
38
36
### Installing the package
37
+
39
38
The SDK is available as an [npm package](https://www.npmjs.com/package/gettyimages-api). Install in your workspace with:
40
39
41
40
```sh
@@ -215,6 +214,7 @@ try {
215
214
console.error("An error occurred while making the custom request:", err);
216
215
}
217
216
```
217
+
218
218
### Add custom parameter and header to a search request
219
219
220
220
```javascript
@@ -235,3 +235,29 @@ try {
235
235
console.error("An error occurred while searching for images:", err);
236
236
}
237
237
```
238
+
239
+
### Reuse a token between instantiations of the client
240
+
241
+
If you need to create new instances of the client between calls, such as in a
242
+
serverless environment, and want to cache the access token between uses, the SDK
243
+
supports this.
244
+
245
+
```javascript
246
+
importapifrom"gettyimages-api";
247
+
// Get the token from your cache. The following line is just an example.
0 commit comments