Skip to content

Commit 33c129d

Browse files
authored
fix: Correct typing and prevents warnings for secure mode hash during initialization. (#59)
Updates the LDOptions typing with the secure mode hash option. Include the hash in the extra type defs for the base. Fixes #57
1 parent 10b9cec commit 33c129d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function initialize(env, context, options = {}) {
1010
const extraOptionDefs = {
1111
localStoragePath: { type: 'string' },
1212
tlsParams: { type: 'object' },
13+
hash: { type: 'string' },
1314
};
1415
if (!options.logger) {
1516
extraOptionDefs.logger = { default: basicLogger() };

typings.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ declare module 'launchdarkly-node-client-sdk' {
6565
* of the TLS-related parameters supported by `https.request()`, such as `ca`, `cert`, and `key`.
6666
*/
6767
tlsParams?: LDTLSOptions;
68+
69+
/**
70+
* The signed context key for Secure Mode.
71+
*
72+
* For more information, see the JavaScript SDK Reference Guide on
73+
* [Secure mode](https://launchdarkly.com/docs/sdk/features/secure-mode#configure-secure-mode-in-javascript-based-sdks).
74+
*/
75+
hash?: string;
6876
}
6977

7078
/**

0 commit comments

Comments
 (0)