@looker/sdk 23.20.0 → 24.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,35 +86,38 @@ By writing your own `getProxyToken()` visible to this class, any proxied authent
86
86
 
87
87
  ```typescript
88
88
  export class EmbedSession extends ProxySession {
89
- constructor(public settings: IApiSettings, transport?: ITransport) {
90
- super(settings, transport)
89
+ constructor(
90
+ public settings: IApiSettings,
91
+ transport?: ITransport
92
+ ) {
93
+ super(settings, transport);
91
94
  }
92
95
 
93
96
  async authenticate(props: any) {
94
97
  // get the auth token from the proxy server
95
- const token = await getProxyToken()
98
+ const token = await getProxyToken();
96
99
  if (token) {
97
100
  // Assign the token, which will track its expiration time automatically
98
- this.activeToken.setToken(token)
101
+ this.activeToken.setToken(token);
99
102
  }
100
103
 
101
104
  if (this.isAuthenticated()) {
102
105
  // Session is authenticated
103
106
  // set CORS mode (in this scenario)
104
- props.mode = 'cors'
107
+ props.mode = 'cors';
105
108
 
106
109
  // remove any credentials attribute that may have been set
107
110
  // because the BrowserTransport defaults to having `same-origin` for credentials
108
- delete props['credentials']
111
+ delete props['credentials'];
109
112
 
110
113
  // replace the headers argument with required values
111
114
  // Note: using new Headers() to construct the headers breaks CORS for the Looker API. Don't know why yet
112
115
  props.headers = {
113
116
  Authorization: `Bearer ${token.access_token}`,
114
117
  'x-looker-appid': agentTag,
115
- }
118
+ };
116
119
  }
117
- return props
120
+ return props;
118
121
  }
119
122
  }
120
123
  ```