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(events): Use new event dispatcher API #77

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 31 additions & 19 deletions .github/workflows/lint-test-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,29 @@ on:
type: string
description: The branch of the SDK to test
required: false

jobs:
lint-test-sdk:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '18', '20', '22', '23' ]
steps:
- uses: actions/checkout@v2
with:
repository: Eppo-exp/node-server-sdk
ref: ${{ env.SDK_BRANCH_NAME }}
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '18.x'
- uses: actions/cache@v2
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: './node_modules'
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install root dependencies
run: yarn --frozen-lockfile
working-directory: ./
Expand All @@ -50,19 +56,25 @@ jobs:
working-directory: ./
typecheck:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '18', '20', '22', '23' ]
steps:
- uses: actions/checkout@v2
with:
repository: Eppo-exp/node-server-sdk
ref: ${{ env.SDK_BRANCH_NAME }}
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '18.x'
- uses: actions/cache@v2
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: './node_modules'
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install root dependencies
run: yarn --frozen-lockfile
working-directory: ./
Expand Down
2 changes: 1 addition & 1 deletion docs/node-server-sdk.getinstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export declare function getInstance(): EppoClient;

EppoClient

a singleton client instance
a singleton client instance or throws an Error if init() has not been called

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.apikey.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.assignmentlogger.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.banditlogger.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.baseurl.md

This file was deleted.

29 changes: 0 additions & 29 deletions docs/node-server-sdk.iclientconfig.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.numinitialrequestretries.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.numpollrequestretries.md

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.pollingintervalms.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.requesttimeoutms.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/node-server-sdk.iclientconfig.throwonfailedinitialization.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/node-server-sdk.init.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## init() function

Initializes the Eppo client with configuration parameters. This method should be called once on application startup. After invocation of this method, the SDK will poll Eppo's API at regular intervals to retrieve assignment configurations.
Initializes the Eppo client with configuration parameters. This method should be called once on application startup. After invocation of this method, the SDK will poll Eppo API at regular intervals to retrieve assignment configurations.

**Signature:**

Expand All @@ -16,7 +16,7 @@ export declare function init(config: IClientConfig): Promise<EppoClient>;

| Parameter | Type | Description |
| --- | --- | --- |
| config | [IClientConfig](./node-server-sdk.iclientconfig.md) | client configuration |
| config | IClientConfig | client configuration |

**Returns:**

Expand Down
8 changes: 1 addition & 7 deletions docs/node-server-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@
| Function | Description |
| --- | --- |
| [getInstance()](./node-server-sdk.getinstance.md) | Used to access a singleton SDK client instance. Use the method after calling init() to initialize the client. |
| [init(config)](./node-server-sdk.init.md) | Initializes the Eppo client with configuration parameters. This method should be called once on application startup. After invocation of this method, the SDK will poll Eppo's API at regular intervals to retrieve assignment configurations. |

## Interfaces

| Interface | Description |
| --- | --- |
| [IClientConfig](./node-server-sdk.iclientconfig.md) | Configuration used for initializing the Eppo client |
| [init(config)](./node-server-sdk.init.md) | Initializes the Eppo client with configuration parameters. This method should be called once on application startup. After invocation of this method, the SDK will poll Eppo API at regular intervals to retrieve assignment configurations. |

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Eppo-exp/node-server-sdk#readme",
"dependencies": {
"@eppo/js-client-sdk-common": "4.3.0",
"@eppo/js-client-sdk-common": "^4.5.0",
"lru-cache": "^10.0.1"
},
"devDependencies": {
Expand All @@ -46,7 +46,7 @@
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"express": "^4.18.0",
"express": "^4.21.1",
"husky": "^6.0.0",
"jest": "^29.7.0",
"lint-staged": "^12.3.5",
Expand All @@ -58,5 +58,6 @@
"engines": {
"node": ">=18.x",
"yarn": "1.x"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Loading