@pusher/push-notifications-web
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -8,5 +8,9 @@ # Changelog | ||
## [Unreleased](https://github.com/pusher/push-notifications-web/compare/1.0.3...HEAD) | ||
## [Unreleased](https://github.com/pusher/push-notifications-web/compare/1.1.0...HEAD) | ||
## [1.0.3](https://github.com/pusher/push-notifications-web/compare/1.0.2...1.0.3) - 2020-08-24 | ||
## [1.1.0](https://github.com/pusher/push-notifications-web/compare/1.0.3...1.1.0) - 2020-09-16 | ||
- Allow the fetch `credentials` option to be overidden in the default TokenProvider | ||
implementation. | ||
## [1.0.3](https://github.com/pusher/push-notifications-web/compare/1.0.2...1.0.3) - 2020-09-10 | ||
- Fix bug in SDK where we weren't waiting for custom Service Workers to become | ||
@@ -13,0 +17,0 @@ ready before starting the SDK |
@@ -12,2 +12,3 @@ export interface TokenProviderResponse { | ||
headers?: { [key: string]: string }; | ||
credentials?: string; | ||
} | ||
@@ -14,0 +15,0 @@ |
{ | ||
"name": "@pusher/push-notifications-web", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/push-notifications-esm.js", |
@@ -1,5 +0,12 @@ | ||
export default function doRequest({ method, path, body = null, headers = {} }) { | ||
export default function doRequest({ | ||
method, | ||
path, | ||
body = null, | ||
headers = {}, | ||
credentials = 'same-origin', | ||
}) { | ||
const options = { | ||
method, | ||
headers, | ||
credentials, | ||
}; | ||
@@ -6,0 +13,0 @@ |
import doRequest from './do-request'; | ||
export default class TokenProvider { | ||
constructor({ url, queryParams, headers } = {}) { | ||
constructor({ url, queryParams, headers, credentials } = {}) { | ||
this.url = url; | ||
this.queryParams = queryParams; | ||
this.headers = headers; | ||
this.credentials = credentials; | ||
} | ||
@@ -19,2 +20,3 @@ | ||
headers: this.headers, | ||
credentials: this.credentials, | ||
}; | ||
@@ -21,0 +23,0 @@ let response = await doRequest(options); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
342840
9249