Skip to content

Commit eb66939

Browse files
committed
export assignment hooks interface. update generated docs
1 parent 530eea6 commit eb66939

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
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;

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)