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: buildAndInit for isolated client instances #166

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e20ef73
detatched construction
typotter Jan 30, 2025
50e66aa
combine new and old constructors
typotter Jan 30, 2025
de9f653
use spark for md5 instead of non-exported member from common
typotter Jan 31, 2025
fa5baab
update to latest common, use exported members
typotter Jan 31, 2025
953c4e4
doc comments
typotter Jan 31, 2025
159df11
wip
typotter Jan 31, 2025
a73bf0c
skip initial config for now
typotter Jan 31, 2025
7e5abe1
exports
typotter Jan 31, 2025
92cdd1d
waitForReady
typotter Jan 31, 2025
c4b2717
clean up offline init method
typotter Jan 31, 2025
ddab6c0
no need to export
typotter Jan 31, 2025
d55d23d
DOCS
typotter Jan 31, 2025
3c18bc9
builder method
typotter Feb 4, 2025
4b8077f
polish
typotter Feb 5, 2025
621cccb
chore: Move initialization code from static to the instance
typotter Feb 11, 2025
ed3c4ce
docs
typotter Feb 11, 2025
5f96888
lint
typotter Feb 12, 2025
228e1e4
move reinit check
typotter Feb 13, 2025
4d35d4f
restore buffered init
typotter Feb 13, 2025
cf3c2ba
docs
typotter Feb 13, 2025
132c0a5
docs
typotter Feb 13, 2025
6141581
polish
typotter Feb 5, 2025
82ec342
test name
typotter Feb 5, 2025
81ff3b1
move comment
typotter Feb 11, 2025
fad43d3
move forceReinit
typotter Feb 13, 2025
febb3f8
docs
typotter Feb 13, 2025
212e26e
move members
typotter Feb 13, 2025
a943e90
refactor wip
typotter Feb 14, 2025
ba219f2
chore: Move initialization code from static to the instance
typotter Feb 11, 2025
5333574
docs
typotter Feb 11, 2025
aab1009
lint
typotter Feb 12, 2025
f93fa61
docs
typotter Feb 13, 2025
030aa33
docs
typotter Feb 14, 2025
e61ec6c
merge fixes
typotter Feb 14, 2025
a000205
fix the horrible diff and merge artifacts
typotter Feb 14, 2025
6f1a68e
docs
typotter Feb 14, 2025
654ffaa
cleamup merge
typotter Feb 14, 2025
74498b9
merge main
typotter Feb 18, 2025
9176d21
docs
typotter Feb 18, 2025
a179e32
merge main
typotter Feb 21, 2025
0734752
chore: lint
typotter Feb 21, 2025
fb76db9
undeprecate
typotter Feb 21, 2025
a384132
chore: additional comments
typotter Feb 21, 2025
3ae0ec7
chore: update docs
typotter Feb 21, 2025
98bd24a
chore: deprecate static EppoJSClient.initialized
typotter Feb 21, 2025
2d45fe5
v3.12.0
typotter Feb 21, 2025
5d3cabc
Merge branch 'main' into tp/namespace
typotter Feb 24, 2025
2712f6b
chore: nit
typotter Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<!-- 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; [buildStorageKeySuffix](./js-client-sdk.buildstoragekeysuffix.md)
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [EppoJSClient](./js-client-sdk.eppojsclient.md) &gt; [buildAndInit](./js-client-sdk.eppojsclient.buildandinit.md)

## buildStorageKeySuffix() function

Builds a storage key suffix from an API key.
## EppoJSClient.buildAndInit() method

**Signature:**

```typescript
export declare function buildStorageKeySuffix(apiKey: string): string;
static buildAndInit(config: IClientConfig): EppoJSClient;
```

## Parameters
Expand All @@ -32,24 +30,20 @@ Description
</th></tr></thead>
<tbody><tr><td>

apiKey
config


</td><td>

string
[IClientConfig](./js-client-sdk.iclientconfig.md)


</td><td>

The API key to build the suffix from


</td></tr>
</tbody></table>
**Returns:**

string

A string suffix for storage keys
[EppoJSClient](./js-client-sdk.eppojsclient.md)

49 changes: 49 additions & 0 deletions docs/js-client-sdk.eppojsclient.init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- 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; [init](./js-client-sdk.eppojsclient.init.md)

## EppoJSClient.init() method

**Signature:**

```typescript
init(config: IClientConfig): Promise<EppoJSClient>;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

config


</td><td>

[IClientConfig](./js-client-sdk.iclientconfig.md)


</td><td>


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;[EppoJSClient](./js-client-sdk.eppojsclient.md)<!-- -->&gt;

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;
```
42 changes: 40 additions & 2 deletions docs/js-client-sdk.eppojsclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Description

</td><td>

`static`


</td><td>

Expand Down Expand Up @@ -96,6 +94,20 @@ Description
</th></tr></thead>
<tbody><tr><td>

[buildAndInit(config)](./js-client-sdk.eppojsclient.buildandinit.md)


</td><td>

`static`


</td><td>


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

[getBanditAction(flagKey, subjectKey, subjectAttributes, actions, defaultValue)](./js-client-sdk.eppojsclient.getbanditaction.md)


Expand Down Expand Up @@ -261,5 +273,31 @@ Description
</td><td>


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

[init(config)](./js-client-sdk.eppojsclient.init.md)


</td><td>


</td><td>


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

[waitForInitialization()](./js-client-sdk.eppojsclient.waitforinitialization.md)


</td><td>


</td><td>

Resolves when the EppoClient has completed its initialization.


</td></tr>
</tbody></table>
17 changes: 17 additions & 0 deletions docs/js-client-sdk.eppojsclient.waitforinitialization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- 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; [waitForInitialization](./js-client-sdk.eppojsclient.waitforinitialization.md)

## EppoJSClient.waitForInitialization() method

Resolves when the EppoClient has completed its initialization.

**Signature:**

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

Promise&lt;void&gt;

8 changes: 6 additions & 2 deletions docs/js-client-sdk.getinstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@

## getInstance() function

> Warning: This API is now obsolete.
>
>

Used to access a singleton SDK client instance. Use the method after calling init() to initialize the client.

**Signature:**

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

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

a singleton client instance

23 changes: 23 additions & 0 deletions docs/js-client-sdk.iapioptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- 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; [IApiOptions](./js-client-sdk.iapioptions.md)

## IApiOptions type

Base options for the EppoClient SDK

**Signature:**

```typescript
export declare type IApiOptions = {
apiKey: string;
baseUrl?: string;
requestTimeoutMs?: number;
numInitialRequestRetries?: number;
skipInitialRequest?: boolean;
throwOnFailedInitialization?: boolean;
maxCacheAgeSeconds?: number;
useExpiredCache?: boolean;
updateOnFetch?: ServingStoreUpdateStrategy;
};
```
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.

Loading
Loading