Skip to content

Commit 7fe05c1

Browse files
committed
🔥 Dropped support for "host" parameter in Content API SDK
refs https://github.com/TryGhost/Toolbox/issues/348 refs 9d44031 - The "host" parameter has been deprecated for few years now. It is not used in any of the clients we maintain and anybody who uses it externally had enough time to migrate.
1 parent 931c845 commit 7fe05c1

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

‎packages/content-api/lib/content-api.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,8 @@ const defaultMakeRequest = ({url, method, params, headers}) => {
5151
* @param {String} [options.ghostPath]
5252
* @param {String|Boolean} options.version - a version string like v3, v4, v5 or boolean value identifying presence of Accept-Version header
5353
* @param {Function} [options.makeRequest]
54-
* @param {String} [options.host] Deprecated
5554
*/
56-
export default function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequest = defaultMakeRequest}) {
57-
/**
58-
* host parameter is deprecated
59-
* @deprecated use "url" instead
60-
*/
61-
if (host) {
62-
// eslint-disable-next-line
63-
console.warn(`${name}: The 'host' parameter is deprecated, please use 'url' instead`);
64-
if (!url) {
65-
url = host;
66-
}
67-
}
68-
55+
export default function GhostContentAPI({url, key, version, ghostPath = 'ghost', makeRequest = defaultMakeRequest}) {
6956
if (this instanceof GhostContentAPI) {
7057
return GhostContentAPI({url, key, version, ghostPath, makeRequest});
7158
}

‎packages/content-api/test/content-api-test/content-api.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('GhostContentApi', function () {
4545
//
4646
}
4747

48-
new GhostContentApi({host: config.url, key: config.key, version: config.version});
48+
new GhostContentApi({url: config.url, key: config.key, version: config.version});
4949
new GhostContentApi(config);
5050
});
5151

0 commit comments

Comments
 (0)