@statickit/core
Advanced tools
Comparing version 2.0.0 to 2.1.0
# Changelog | ||
## 2.1.0 | ||
- Add a `startBrowserSession` function to the client | ||
Now, you can safely run `createClient` on the server-side, because instantiation | ||
no longer relies on `window` being there 🎉 | ||
## 2.0.0 | ||
@@ -7,4 +14,5 @@ | ||
- Accept `site` option in factory | ||
- Add `invoke` method to client | ||
- Add `invokeFunction` method to client | ||
- **Breaking change**: Export a `createClient` factory function (instead of as a default value) | ||
- **Breaking change**: New argument structure for `submitForm` (using the form `key` is now required) | ||
@@ -11,0 +19,0 @@ ## 1.5.0 |
@@ -865,3 +865,3 @@ 'use strict'; | ||
var version = "2.0.0"; | ||
var version = "2.1.0"; | ||
@@ -1002,6 +1002,5 @@ /** | ||
this.site = config.site; | ||
this.session = new Session(); | ||
} | ||
/** | ||
* Teardown the client session. | ||
* Starts a browser session. | ||
*/ | ||
@@ -1011,5 +1010,16 @@ | ||
_createClass(StaticKit, [{ | ||
key: "startBrowserSession", | ||
value: function startBrowserSession() { | ||
if (!this.session) { | ||
this.session = new Session(); | ||
} | ||
} | ||
/** | ||
* Teardown the client session. | ||
*/ | ||
}, { | ||
key: "teardown", | ||
value: function teardown() { | ||
this.session.teardown(); | ||
if (this.session) this.session.teardown(); | ||
} | ||
@@ -1039,3 +1049,6 @@ /** | ||
append(data, '_t', encode64(this.session.data())); | ||
if (this.session) { | ||
append(data, '_t', encode64(this.session.data())); | ||
} | ||
var headers = { | ||
@@ -1042,0 +1055,0 @@ 'StaticKit-Client': clientHeader(opts.clientName) |
@@ -861,3 +861,3 @@ function _classCallCheck(instance, Constructor) { | ||
var version = "2.0.0"; | ||
var version = "2.1.0"; | ||
@@ -998,6 +998,5 @@ /** | ||
this.site = config.site; | ||
this.session = new Session(); | ||
} | ||
/** | ||
* Teardown the client session. | ||
* Starts a browser session. | ||
*/ | ||
@@ -1007,5 +1006,16 @@ | ||
_createClass(StaticKit, [{ | ||
key: "startBrowserSession", | ||
value: function startBrowserSession() { | ||
if (!this.session) { | ||
this.session = new Session(); | ||
} | ||
} | ||
/** | ||
* Teardown the client session. | ||
*/ | ||
}, { | ||
key: "teardown", | ||
value: function teardown() { | ||
this.session.teardown(); | ||
if (this.session) this.session.teardown(); | ||
} | ||
@@ -1035,3 +1045,6 @@ /** | ||
append(data, '_t', encode64(this.session.data())); | ||
if (this.session) { | ||
append(data, '_t', encode64(this.session.data())); | ||
} | ||
var headers = { | ||
@@ -1038,0 +1051,0 @@ 'StaticKit-Client': clientHeader(opts.clientName) |
@@ -12,2 +12,6 @@ /// <reference types="promise-polyfill" /> | ||
/** | ||
* Starts a browser session. | ||
*/ | ||
startBrowserSession(): void; | ||
/** | ||
* Teardown the client session. | ||
@@ -14,0 +18,0 @@ */ |
{ | ||
"name": "@statickit/core", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "The core library for StaticKit", | ||
@@ -5,0 +5,0 @@ "homepage": "https://statickit.com", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73932
2156