Skip to content

Commit

Permalink
Merge pull request #3 from Eppo-exp/export-hooks-interface-update-docs
Browse files Browse the repository at this point in the history
Export assignment hooks interface. update generated docs
  • Loading branch information
petzel committed Aug 17, 2023
2 parents 530eea6 + 5847e33 commit 4de6b91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions js-client-sdk-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class EppoClient implements IEppoClient {
// (undocumented)
getAssignment(subjectKey: string, experimentKey: string, subjectAttributes?: {}): string;
// (undocumented)
getAssignmentWithHooks(subjectKey: string, experimentKey: string, subjectAttributes: {}, assignmentHooks: IAssignmentHooks): Promise<string>;
// (undocumented)
setLogger(logger: IAssignmentLogger): void;
}

Expand Down Expand Up @@ -56,6 +58,12 @@ export interface IAssignmentEvent {
variation: string;
}

// @public
export interface IAssignmentHooks {
onPostAssignment(variation: string): Promise<void>;
onPreAssignment(subject: string): Promise<string | null>;
}

// @public
export interface IAssignmentLogger {
logAssignment(assignment: IAssignmentEvent): void;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eppo/js-client-sdk-common",
"version": "1.2.0",
"version": "1.2.1",
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IAssignmentHooks } from './assignment-hooks';
import { IAssignmentLogger, IAssignmentEvent } from './assignment-logger';
import EppoClient, { IEppoClient } from './client/eppo-client';
import { IConfigurationStore } from './configuration-store';
Expand All @@ -7,6 +8,7 @@ import HttpClient from './http-client';
import * as validation from './validation';

export {
IAssignmentHooks,
IAssignmentLogger,
IAssignmentEvent,
EppoClient,
Expand Down

0 comments on commit 4de6b91

Please sign in to comment.