Skip to content

Commit 4de6b91

Browse files
authored
Merge pull request #3 from Eppo-exp/export-hooks-interface-update-docs
Export assignment hooks interface. update generated docs
2 parents 530eea6 + 5847e33 commit 4de6b91

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

js-client-sdk-common.api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export class EppoClient implements IEppoClient {
2626
// (undocumented)
2727
getAssignment(subjectKey: string, experimentKey: string, subjectAttributes?: {}): string;
2828
// (undocumented)
29+
getAssignmentWithHooks(subjectKey: string, experimentKey: string, subjectAttributes: {}, assignmentHooks: IAssignmentHooks): Promise<string>;
30+
// (undocumented)
2931
setLogger(logger: IAssignmentLogger): void;
3032
}
3133

@@ -56,6 +58,12 @@ export interface IAssignmentEvent {
5658
variation: string;
5759
}
5860

61+
// @public
62+
export interface IAssignmentHooks {
63+
onPostAssignment(variation: string): Promise<void>;
64+
onPreAssignment(subject: string): Promise<string | null>;
65+
}
66+
5967
// @public
6068
export interface IAssignmentLogger {
6169
logAssignment(assignment: IAssignmentEvent): void;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/js-client-sdk-common",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)",
55
"main": "dist/index.js",
66
"files": [

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { IAssignmentHooks } from './assignment-hooks';
12
import { IAssignmentLogger, IAssignmentEvent } from './assignment-logger';
23
import EppoClient, { IEppoClient } from './client/eppo-client';
34
import { IConfigurationStore } from './configuration-store';
@@ -7,6 +8,7 @@ import HttpClient from './http-client';
78
import * as validation from './validation';
89

910
export {
11+
IAssignmentHooks,
1012
IAssignmentLogger,
1113
IAssignmentEvent,
1214
EppoClient,

0 commit comments

Comments
 (0)