Skip to content

Commit 198fc77

Browse files
authored
Prepare v10.0.0 release (#60)
* Update JSDoc documentation * Add CHANGELOG.md * Bump version * Update README.md
1 parent a7e7d8c commit 198fc77

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please check the [Github Releases](https://github.com/configcat/node-sdk/releases) page for the changelog of the ConfigCat SDK for Node.js.

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const configcat = require("configcat-node");
3030
const configCatClient = configcat.getClient("#YOUR-SDK-KEY#");
3131
```
3232

33-
> We strongly recommend using the *ConfigCat Client* as a Singleton object in your application.
33+
> You can acquire singleton client instances for your SDK keys using the `getClient("<sdkKey>")` factory function.
34+
(However, please keep in mind that subsequent calls to `getClient()` with the *same SDK Key* return a *shared* client instance, which was set up by the first call.)
3435

3536
### 4. Get your setting value:
3637
The async/await way:

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "configcat-node",
3-
"version": "9.1.1",
3+
"version": "10.0.0",
44
"description": "Official ConfigCat SDK to help you access your feature flags from a Node.js application.",
55
"main": "lib/client.js",
66
"types": "lib/client.d.ts",

Diff for: src/client.ts

+20-9
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { HttpConfigFetcher } from "./config-fetcher";
55
import CONFIGCAT_SDK_VERSION from "./version";
66

77
/**
8-
* Returns an instance of ConfigCatClient for the specified SDK Key.
8+
* Returns an instance of `ConfigCatClient` for the specified SDK Key.
99
* @remarks This method returns a single, shared instance per each distinct SDK Key.
1010
* That is, a new client object is created only when there is none available for the specified SDK Key.
11-
* Otherwise, the already created instance is returned (in which case the 'pollingMode' and 'options' arguments are ignored).
11+
* Otherwise, the already created instance is returned (in which case the `pollingMode` and `options` arguments are ignored).
1212
* So, please keep in mind that when you make multiple calls to this method using the same SDK Key, you may end up with multiple references to the same client object.
13-
* @param sdkKey SDK Key to access configuration
14-
* @param pollingMode The polling mode to use
15-
* @param options Options for the specified polling mode
13+
* @param sdkKey SDK Key to access the ConfigCat config.
14+
* @param pollingMode The polling mode to use.
15+
* @param options Options for the specified polling mode.
1616
*/
1717
export function getClient<TMode extends PollingMode | undefined>(sdkKey: string, pollingMode?: TMode, options?: OptionsForPollingMode<TMode>): IConfigCatClient {
1818
return configcatcommon.getClient(sdkKey, pollingMode ?? PollingMode.AutoPoll, options,
@@ -24,30 +24,41 @@ export function getClient<TMode extends PollingMode | undefined>(sdkKey: string,
2424
}
2525

2626
/**
27-
* Disposes all existing ConfigCatClient instances.
27+
* Disposes all existing `ConfigCatClient` instances.
2828
*/
2929
export function disposeAllClients(): void {
3030
configcatcommon.disposeAllClients();
3131
}
3232

3333
/**
34-
* Create an instance of ConfigCatConsoleLogger
35-
* @param logLevel Specifies message's filtering to output for the CofigCatConsoleLogger.
34+
* Creates an instance of `ConfigCatConsoleLogger`.
35+
* @param logLevel Log level (the minimum level to use for filtering log events).
3636
*/
3737
export function createConsoleLogger(logLevel: LogLevel): IConfigCatLogger {
3838
return configcatcommon.createConsoleLogger(logLevel);
3939
}
4040

41+
/**
42+
* Creates an instance of `FlagOverrides` that uses a map data source.
43+
* @param map The map that contains the overrides.
44+
* @param behaviour The override behaviour.
45+
* Specifies whether the local values should override the remote values
46+
* or local values should only be used when a remote value doesn't exist
47+
* or the local values should be used only.
48+
*/
4149
export function createFlagOverridesFromMap(map: { [name: string]: NonNullable<SettingValue> }, behaviour: OverrideBehaviour): FlagOverrides {
4250
return new FlagOverrides(new MapOverrideDataSource(map), behaviour);
4351
}
4452

53+
/** Options used to configure the ConfigCat SDK in the case of Auto Polling mode. */
4554
export interface INodeAutoPollOptions extends IAutoPollOptions {
4655
}
4756

57+
/** Options used to configure the ConfigCat SDK in the case of Lazy Loading mode. */
4858
export interface INodeLazyLoadingOptions extends ILazyLoadingOptions {
4959
}
5060

61+
/** Options used to configure the ConfigCat SDK in the case of Manual Polling mode. */
5162
export interface INodeManualPollOptions extends IManualPollOptions {
5263
}
5364

@@ -98,4 +109,4 @@ export { OverrideBehaviour } from "configcat-common";
98109

99110
export { RefreshResult } from "configcat-common";
100111

101-
export type { IProvidesHooks, HookEvents } from "configcat-common";
112+
export type { IProvidesHooks, HookEvents } from "configcat-common";

0 commit comments

Comments
 (0)