From 91697f06f0de77bc3c0b3004ed81223863e504ce Mon Sep 17 00:00:00 2001 From: danoswaltCL <97542869+danoswaltCL@users.noreply.github.com> Date: Fri, 23 Jun 2023 16:00:20 -0400 Subject: [PATCH] add docs (#896) * add docs * add more to readme for npm --- clientlibs/js/src/UpgradeClient.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/clientlibs/js/src/UpgradeClient.ts b/clientlibs/js/src/UpgradeClient.ts index fdfa2f3930..9f59d58a78 100644 --- a/clientlibs/js/src/UpgradeClient.ts +++ b/clientlibs/js/src/UpgradeClient.ts @@ -48,6 +48,31 @@ import Assignment from './Assignment'; * ``` */ +/** + * UpGradeClient is the main class for interacting with the UpGrade API. + * + * @example +* ```typescript +* import UpgradeClient from 'upgrade_client_lib/dist/browser'; +* ``` +* +* ```typescript +* import UpgradeClient from 'upgrade_client_lib/dist/node'; +* ``` +* +* General UpGrade types can also be accessed as named exports: +* ```typescript +* import UpgradeClient, { IExperimentAssignment } from 'upgrade_client_lib/dist/browser'; +* ``` +* +* SDK-Specific types can be accessed also: +* ```typescript +* import { Interfaces } from 'upgrade_client_lib/dist/clientlibs/js/src/identifiers'; +* +* const initResponse: Interfaces.IUser = await upgradeClient.init(); +* ``` +*/ + export default class UpgradeClient { // Endpoints URLs private api: UpGradeClientInterfaces.IEndpoints = {