Skip to content

Commit 066ae83

Browse files
committed
wip
1 parent 765b492 commit 066ae83

File tree

2 files changed

+50
-10
lines changed

2 files changed

+50
-10
lines changed

website/docs/sdk-reference/dotnet.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ These are the available options on the `ConfigCatClientOptions` class:
117117
| `HttpClientHandler` | Optional, `HttpClientHandler` to provide network credentials and proxy settings. [More about the proxy settings](#using-configcat-behind-a-proxy). | built-in `HttpClientHandler` |
118118
| `HttpTimeout` | Optional, sets the underlying HTTP client's timeout. [More about the HTTP timeout](#http-timeout). | `TimeSpan.FromSeconds(30)` |
119119
| `FlagOverrides` | Optional, sets the local feature flag & setting overrides. [More about feature flag overrides](#flag-overrides). | |
120-
| `DataGovernance` | Optional, defaults to `Global`. Describes the location of your feature flag and setting data within the ConfigCat CDN. This parameter needs to be in sync with your Data Governance preferences. [More about Data Governance](../advanced/data-governance.mdx). Available options: `Global`, `EuOnly` | `Global` |
120+
| `DataGovernance` | Optional, describes the location of your feature flag and setting data within the ConfigCat CDN. This parameter needs to be in sync with your Data Governance preferences. [More about Data Governance](../advanced/data-governance.mdx). Available options: `Global`, `EuOnly` | `Global` |
121121
| `DefaultUser` | Optional, sets the default user. [More about default user](#default-user). | `null` (none) |
122122
| `Offline` | Optional, determines whether the client should be initialized to offline mode. [More about offline mode](#online--offline-mode). | `false` |
123123

website/docs/sdk-reference/js/_template.mdx

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ import If from '@site/src/components/If';
99
*/}
1010

1111
export const sdks = {
12-
"": { pageId: "overview", name: "ConfigCat SDK for JavaScript" },
13-
"browser": { pageId: "js", name: "Browser (JavaScript) SDK" },
12+
"browser": { pageId: "browser", name: "Browser (JavaScript) SDK" },
1413
"bun": { pageId: "bun", name: "Bun SDK" },
1514
"chromium-extension": { pageId: "chromium-extension", name: "Chromium Extension SDK" },
1615
"cloudflare-worker": { pageId: "cloudflare-worker", name: "Cloudflare Worker SDK" },
1716
"deno": { pageId: "deno", name: "Deno SDK" },
1817
"node": { pageId: "node", name: "Node.js SDK" },
1918
};
2019

21-
export const getPageId = (platform) => sdks[platform ?? ""].id;
20+
export const getPageId = (platform) => platform ? sdks[platform].pageId : "overview";
2221

23-
export const getSdkName = (platform) => sdks[platform ?? ""].name;
22+
export const getSdkName = (platform) => platform ? sdks[platform].name : "ConfigCat SDK for JavaScript";
2423

2524
export const showCodePenDemoSection = (platform) => !platform || platform === "browser";
2625

@@ -42,6 +41,21 @@ export const getAdjustedToc = (platform) => {
4241
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=configcat_js-sdk&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=configcat_js-sdk)
4342
[![JSDELIVR](https://data.jsdelivr.com/v1/package/npm/@configcat/sdk/badge)](https://data.jsdelivr.com/v1/package/npm/@configcat/sdk/badge)
4443

44+
<If condition={!props.platform}>
45+
46+
:::info
47+
The ConfigCat SDK for JavaScript provides the following platform-specific SDKs as a [single, unified NPM package](https://www.npmjs.com/package/@configcat/sdk):
48+
<ul>
49+
{Object.keys(sdks).map((platform, index) => (
50+
<li key={index}>
51+
<Link to={`../${getPageId(platform)}`}>{getSdkName(platform)}</Link>
52+
</li>
53+
))}
54+
</ul>
55+
:::
56+
57+
</If>
58+
4559
<If condition={props.platform === "browser"}>
4660

4761
:::info
@@ -310,24 +324,50 @@ The `getClient` function has optional parameters, which can be used to adjust th
310324

311325
The available options depends on the chosen polling mode. However, there are some common options which can be set in the case of every polling mode:
312326

313-
export const getDefaultConfigFetcherImpl = (platform) =>
327+
export const getDefaultConfigFetcherImpl = (platform) =>
314328
platform === "browser" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/browser/XmlHttpRequestConfigFetcher.ts"><code>XmlHttpRequestConfigFetcher</code></Link>
315329
: platform === "bun" || platform === "node" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/node/NodeHttpConfigFetcher.ts"><code>NodeHttpConfigFetcher</code></Link>
316330
: platform === "chromium-extension" || platform === "cloudflare-worker" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/shared/FetchApiConfigFetcher.ts"><code>FetchApiConfigFetcher</code></Link>
317331
: platform === "deno" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/deno/DenoHttpConfigFetcher.ts"><code>DenoHttpConfigFetcher</code></Link>
318332
: <>a default implementation corresponding to the platform</>;
319333

320-
<If condition={true}>
334+
export const getDefaultCacheImpl = (platform) =>
335+
platform === "browser" ? <><Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/browser/LocalStorageConfigCache.ts"><code>LocalStorageConfigCache</code></Link> or e <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/shared/IndexedDBConfigCache.ts"><code>IndexedDBConfigCache</code></Link></>
336+
: platform === "bun" || platform === "deno" || platform === "node" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatCache.ts"><code>InMemoryConfigCache</code></Link>
337+
: platform === "chromium-extension" ? <><Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/chromium-extension/ChromeLocalStorageConfigCache.ts"><code>ChromeLocalStorageConfigCache</code></Link> or <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/shared/IndexedDBConfigCache.ts"><code>IndexedDBConfigCache</code></Link></>
338+
: platform === "cloudflare-worker" ? <Link to="https://github.com/configcat/js-unified-sdk/blob/master/src/cloudflare-worker/CloudflareConfigCache.ts"><code>CloudflareConfigCache</code></Link>
339+
: <>a default implementation corresponding to the platform</>;
340+
341+
<If condition={props.platform !== "node"}>
321342

322343
| Option Parameter | Description | Default |
323344
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
324-
| `configFetcher` | Custom [`IConfigCatConfigFetcher`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigFetcher.ts) instance for downloading a config. | {getDefaultConfigFetcherImpl(props.platform)} |
325-
| `cache` | Custom [`IConfigCatCache`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatCache.ts) implementation for caching the downloaded config. | [`InMemoryConfigCache`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatCache.ts) |
345+
| `configFetcher` | Custom [`IConfigCatConfigFetcher`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigFetcher.ts) instance for downloading a config. | { getDefaultConfigFetcherImpl(props.platform) } |
346+
| `cache` | Custom [`IConfigCatCache`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatCache.ts) implementation for caching the downloaded config. | { getDefaultCacheImpl(props.platform) } |
326347
| `logger` | Custom [`IConfigCatLogger`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatLogger.ts) implementation for tracing. | [`ConfigCatConsoleLogger`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatLogger.ts) (with WARN level) |
348+
| `logFilter` | Sets a custom log filter. [More about log filtering](#log-filtering). | `undefined` (none) |
349+
| `baseUrl` | Sets the CDN base url (forward proxy, dedicated subscription) from where the SDK will download the config JSON. | |
327350
| `requestTimeoutMs` | The amount of milliseconds the SDK waits for a response from the ConfigCat servers before returning values from the cache. | 30000 |
351+
| `flagOverrides` | Local feature flag & setting overrides. [More about feature flag overrides](#flag-overrides). | |
352+
| `dataGovernance` | Describes the location of your feature flag and setting data within the ConfigCat CDN. This parameter needs to be in sync with your Data Governance preferences. [More about Data Governance](../../advanced/data-governance.mdx). Available options: `DataGovernance.Global`, `DataGovernance.EuOnly`. | `DataGovernance.Global` |
353+
| `defaultUser` | Sets the default user. [More about default user](#default-user). | `undefined` (none) |
354+
| `offline` | Determines whether the client should be initialized to offline mode. [More about offline mode](#online--offline-mode). | `false` |
355+
356+
</If>
357+
358+
<If condition={props.platform === "node"}>
359+
360+
| Option Parameter | Description | Default |
361+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
362+
| `configFetcher` | Custom [`IConfigCatConfigFetcher`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigFetcher.ts) instance for downloading a config. | { getDefaultConfigFetcherImpl(props.platform) } |
363+
| `cache` | Custom [`IConfigCatCache`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatCache.ts) implementation for caching the downloaded config. | { getDefaultCacheImpl(props.platform) } |
364+
| `logger` | Custom [`IConfigCatLogger`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatLogger.ts) implementation for tracing. | [`ConfigCatConsoleLogger`](https://github.com/configcat/js-unified-sdk/blob/master/src/ConfigCatLogger.ts) (with WARN level) |
365+
| `logFilter` | Sets a custom log filter. [More about log filtering](#log-filtering). | `undefined` (none) |
328366
| `baseUrl` | Sets the CDN base url (forward proxy, dedicated subscription) from where the SDK will download the config JSON. | |
367+
| `proxy` | Proxy settings. [More about the proxy settings](#using-configcat-behind-a-proxy). | |
368+
| `requestTimeoutMs` | The amount of milliseconds the SDK waits for a response from the ConfigCat servers before returning values from the cache. | 30000 |
369+
| `flagOverrides` | Local feature flag & setting overrides. [More about feature flag overrides](#flag-overrides). | |
329370
| `dataGovernance` | Describes the location of your feature flag and setting data within the ConfigCat CDN. This parameter needs to be in sync with your Data Governance preferences. [More about Data Governance](../../advanced/data-governance.mdx). Available options: `DataGovernance.Global`, `DataGovernance.EuOnly`. | `DataGovernance.Global` |
330-
| `flagOverrides` | Local feature flag & setting overrides. [More about feature flag overrides](#flag-overrides). | - |
331371
| `defaultUser` | Sets the default user. [More about default user](#default-user). | `undefined` (none) |
332372
| `offline` | Determines whether the client should be initialized to offline mode. [More about offline mode](#online--offline-mode). | `false` |
333373

0 commit comments

Comments
 (0)