Skip to content

Commit

Permalink
Update Eppo sdk common lib to v1.2.0 (#17)
Browse files Browse the repository at this point in the history
* update sdk common lib to latest

* update generated docs
  • Loading branch information
petzel authored Aug 17, 2023
1 parent 871aebf commit e1353e5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
27 changes: 12 additions & 15 deletions js-client-sdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
```ts

// @public
export function getInstance(): IEppoClient;
import { EppoClient } from '@eppo/js-client-sdk-common';
import { IAssignmentEvent } from '@eppo/js-client-sdk-common';
import { IAssignmentLogger } from '@eppo/js-client-sdk-common';
import { IEppoClient } from '@eppo/js-client-sdk-common';

// @public
export interface IAssignmentEvent {
experiment: string;
subject: string;
export class EppoJSClient extends EppoClient {
// (undocumented)
subjectAttributes: Record<string, any>;
timestamp: string;
variation: string;
static instance: EppoJSClient;
}

// @public
export interface IAssignmentLogger {
logAssignment(assignment: IAssignmentEvent): void;
}
export function getInstance(): IEppoClient;

export { IAssignmentEvent }

export { IAssignmentLogger }

// @public
export interface IClientConfig {
Expand All @@ -29,10 +29,7 @@ export interface IClientConfig {
baseUrl?: string;
}

// @public
export interface IEppoClient {
getAssignment(subjectKey: string, experimentKey: string, subjectAttributes?: Record<string, any>): string;
}
export { IEppoClient }

// @public
export function init(config: IClientConfig): Promise<IEppoClient>;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eppo/js-client-sdk",
"version": "1.0.0",
"version": "1.1.0",
"description": "Eppo SDK for client-side JavaScript applications",
"main": "dist/index.js",
"files": [
Expand Down Expand Up @@ -56,7 +56,7 @@
"xhr-mock": "^2.5.1"
},
"dependencies": {
"@eppo/js-client-sdk-common": "1.1.0",
"@eppo/js-client-sdk-common": "^1.2.0",
"axios": "^0.27.2",
"md5": "^2.3.0"
}
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export interface IClientConfig {
export { IAssignmentLogger, IAssignmentEvent, IEppoClient } from '@eppo/js-client-sdk-common';

const localStorage = new EppoLocalStorage();

/**
* Client for assigning experiment variations.
* @public
*/
export class EppoJSClient extends EppoClient {
public static instance: EppoJSClient = new EppoJSClient(localStorage);
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==

"@eppo/js-client-sdk-common@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-1.1.0.tgz#490bb69b48ae8c0ab4aa9baf26f11f06a9c5233d"
integrity sha512-sREoQxJYQhmVt98/lygZVOausca6MFtqxQQwm8+DZW0bBMkDrfPkhZQ1tL84ux0KnrzRhOU4xy0NZypOBLg7Vw==
"@eppo/js-client-sdk-common@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-1.2.0.tgz#b5267127f9e2b2cfde79f1e8d05058ccb358420f"
integrity sha512-deqSbrutzXdWyKFydXcIUViuCoyvbWIp2ZKX+4Eowbb86NDbB9VGEa55f5ET/+Z8xZ+QcCZ4kuEisIkRD6nlxA==
dependencies:
axios "^0.27.2"
md5 "^2.3.0"
Expand Down

0 comments on commit e1353e5

Please sign in to comment.