Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: non-singleton EppoJSClient #166

Open
wants to merge 14 commits into
base: typo/no-singleton
Choose a base branch
from
47 changes: 47 additions & 0 deletions docs/js-client-sdk.eppojsclient._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [EppoJSClient](./js-client-sdk.eppojsclient.md) &gt; [(constructor)](./js-client-sdk.eppojsclient._constructor_.md)

## EppoJSClient.(constructor)

Constructs a new instance of the `EppoJSClient` class

**Signature:**

```typescript
constructor(optionsOrConfig: EppoClientParameters | IClientOptions);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

optionsOrConfig


</td><td>

EppoClientParameters \| IClientOptions


</td><td>


</td></tr>
</tbody></table>
2 changes: 1 addition & 1 deletion docs/js-client-sdk.eppojsclient.initialized.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
**Signature:**

```typescript
static initialized: boolean;
initialized: boolean;
```
48 changes: 46 additions & 2 deletions docs/js-client-sdk.eppojsclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,40 @@ export declare class EppoJSClient extends EppoClient
```
**Extends:** EppoClient

## Constructors

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(optionsOrConfig)](./js-client-sdk.eppojsclient._constructor_.md)


</td><td>


</td><td>

Constructs a new instance of the `EppoJSClient` class


</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>
Expand Down Expand Up @@ -43,8 +77,6 @@ Description

</td><td>

`static`


</td><td>

Expand Down Expand Up @@ -261,5 +293,17 @@ Description
</td><td>


</td></tr>
<tr><td>

[waitForReady()](./js-client-sdk.eppojsclient.waitforready.md)


</td><td>


</td><td>


</td></tr>
</tbody></table>
15 changes: 15 additions & 0 deletions docs/js-client-sdk.eppojsclient.waitforready.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [EppoJSClient](./js-client-sdk.eppojsclient.md) &gt; [waitForReady](./js-client-sdk.eppojsclient.waitforready.md)

## EppoJSClient.waitForReady() method

**Signature:**

```typescript
waitForReady(): Promise<void>;
```
**Returns:**

Promise&lt;void&gt;

4 changes: 2 additions & 2 deletions docs/js-client-sdk.getinstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Used to access a singleton SDK client instance. Use the method after calling ini
**Signature:**

```typescript
export declare function getInstance(): EppoClient;
export declare function getInstance(): EppoJSClient;
```
**Returns:**

EppoClient
[EppoJSClient](./js-client-sdk.eppojsclient.md)

a singleton client instance

20 changes: 0 additions & 20 deletions docs/js-client-sdk.iclientconfig.eventingestionconfig.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/js-client-sdk.iclientconfig.forcereinitialize.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/js-client-sdk.iclientconfig.maxcacheageseconds.md

This file was deleted.

163 changes: 2 additions & 161 deletions docs/js-client-sdk.iclientconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,171 +2,12 @@

[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IClientConfig](./js-client-sdk.iclientconfig.md)

## IClientConfig interface
## IClientConfig type

Configuration for regular client initialization

**Signature:**

```typescript
export interface IClientConfig extends IBaseRequestConfig
export declare type IClientConfig = Omit<IClientOptions, 'sdkKey' | 'offline'> & Pick<IBaseRequestConfig, 'apiKey'>;
```
**Extends:** IBaseRequestConfig

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[eventIngestionConfig?](./js-client-sdk.iclientconfig.eventingestionconfig.md)


</td><td>


</td><td>

{ deliveryIntervalMs?: number; retryIntervalMs?: number; maxRetryDelayMs?: number; maxRetries?: number; batchSize?: number; maxQueueSize?: number; }


</td><td>

_(Optional)_ Configuration settings for the event dispatcher


</td></tr>
<tr><td>

[forceReinitialize?](./js-client-sdk.iclientconfig.forcereinitialize.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ Force reinitialize the SDK if it is already initialized.


</td></tr>
<tr><td>

[maxCacheAgeSeconds?](./js-client-sdk.iclientconfig.maxcacheageseconds.md)


</td><td>


</td><td>

number


</td><td>

_(Optional)_ Maximum age, in seconds, previously cached values are considered valid until new values will be fetched (default: 0)


</td></tr>
<tr><td>

[persistentStore?](./js-client-sdk.iclientconfig.persistentstore.md)


</td><td>


</td><td>

IAsyncStore&lt;Flag&gt;


</td><td>

_(Optional)_ A custom class to use for storing flag configurations. This is useful for cases where you want to use a different storage mechanism than the default storage provided by the SDK.


</td></tr>
<tr><td>

[throwOnFailedInitialization?](./js-client-sdk.iclientconfig.throwonfailedinitialization.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ Throw an error if unable to fetch an initial configuration during initialization. (default: true)


</td></tr>
<tr><td>

[updateOnFetch?](./js-client-sdk.iclientconfig.updateonfetch.md)


</td><td>


</td><td>

ServingStoreUpdateStrategy


</td><td>

_(Optional)_ Sets how the configuration is updated after a successful fetch - always: immediately start using the new configuration - expired: immediately start using the new configuration only if the current one has expired - empty: only use the new configuration if the current one is both expired and uninitialized/empty


</td></tr>
<tr><td>

[useExpiredCache?](./js-client-sdk.iclientconfig.useexpiredcache.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ Whether initialization will be considered successfully complete if expired cache values are loaded. If false, initialization will always wait for a fetch if cached values are expired. (default: false)


</td></tr>
</tbody></table>
13 changes: 0 additions & 13 deletions docs/js-client-sdk.iclientconfig.persistentstore.md

This file was deleted.

Loading