Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/screeb-sdk-angular/docs/classes/Screeb.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
- [load](Screeb.md#load)
- [messageClose](Screeb.md#messageclose)
- [messageStart](Screeb.md#messagestart)
- [sessionReplayStart](Screeb.md#sessionreplaystart)
- [sessionReplayStop](Screeb.md#sessionreplaystop)
- [surveyClose](Screeb.md#surveyclose)
- [surveyStart](Screeb.md#surveystart)
- [targetingCheck](Screeb.md#targetingcheck)
Expand Down Expand Up @@ -482,6 +484,42 @@ this.screeb.messageStart(

___

### sessionReplayStart

▸ **sessionReplayStart**(): `Promise`\<`unknown`\>

Starts a session replay.

#### Returns

`Promise`\<`unknown`\>

**`Example`**

```ts
this.screeb.sessionReplayStart();
```

___

### sessionReplayStop

▸ **sessionReplayStop**(): `Promise`\<`unknown`\>

Interrupts a running session replay.

#### Returns

`Promise`\<`unknown`\>

**`Example`**

```ts
this.screeb.sessionReplayStop();
```

___

### surveyClose

▸ **surveyClose**(): `Promise`\<`unknown`\>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,34 @@ export class Screeb {
);
}

/**
* Interrupts a running session replay.
*
* @example
* ```ts
* this.screeb.sessionReplayStop();
* ```
*/
public async sessionReplayStop() {
await this.ensureScreeb("sessionReplayStop");

return _Screeb.sessionReplayStop();
}

/**
* Starts a session replay.
*
* @example
* ```ts
* this.screeb.sessionReplayStart();
* ```
*/
public async sessionReplayStart() {
await this.ensureScreeb("sessionReplayStart");

return _Screeb.sessionReplayStart();
}

/**
* Forces a targeting check.
*
Expand Down
42 changes: 42 additions & 0 deletions packages/screeb-sdk-browser/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
- [load](README.md#load)
- [messageClose](README.md#messageclose)
- [messageStart](README.md#messagestart)
- [sessionReplayStart](README.md#sessionreplaystart)
- [sessionReplayStop](README.md#sessionreplaystop)
- [surveyClose](README.md#surveyclose)
- [surveyStart](README.md#surveystart)
- [targetingCheck](README.md#targetingcheck)
Expand Down Expand Up @@ -1036,6 +1038,46 @@ Screeb.messageStart(

___

### sessionReplayStart

▸ **sessionReplayStart**(): `void` \| `Promise`\<`unknown`\>

Starts a session replay.

#### Returns

`void` \| `Promise`\<`unknown`\>

**`Example`**

```ts
import * as Screeb from "@screeb/sdk-browser";

Screeb.sessionReplayStart();
```

___

### sessionReplayStop

▸ **sessionReplayStop**(): `void` \| `Promise`\<`unknown`\>

Interrupts a running session replay.

#### Returns

`void` \| `Promise`\<`unknown`\>

**`Example`**

```ts
import * as Screeb from "@screeb/sdk-browser";

Screeb.sessionReplayStop();
```

___

### surveyClose

▸ **surveyClose**(): `void` \| `Promise`\<`unknown`\>
Expand Down
25 changes: 25 additions & 0 deletions packages/screeb-sdk-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,31 @@ export const messageStart = (
hooks: hooks,
});

/**
* Interrupts a running session replay.
*
* @example
* ```ts
* import * as Screeb from "@screeb/sdk-browser";
*
* Screeb.sessionReplayStop();
* ```
*/
export const sessionReplayStop = () => callScreebCommand("session-replay.stop");

/**
* Starts a session replay.
*
* @example
* ```ts
* import * as Screeb from "@screeb/sdk-browser";
*
* Screeb.sessionReplayStart();
* ```
*/
export const sessionReplayStart = () =>
callScreebCommand("session-replay.start");

/**
* Forces a targeting check.
*
Expand Down
52 changes: 52 additions & 0 deletions packages/screeb-sdk-react/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- [ScreebContextValues](README.md#screebcontextvalues)
- [ScreebProps](README.md#screebprops)
- [ScreebProviderProps](README.md#screebproviderprops)
- [SessionReplayStartFunction](README.md#sessionreplaystartfunction)
- [SessionReplayStopFunction](README.md#sessionreplaystopfunction)
- [SurveyCloseFunction](README.md#surveyclosefunction)
- [SurveyStartFunction](README.md#surveystartfunction)
- [TargetingCheckFunction](README.md#targetingcheckfunction)
Expand Down Expand Up @@ -527,6 +529,8 @@ Screeb context API
| `load` | [`LoadFunction`](README.md#loadfunction) |
| `messageClose` | [`MessageCloseFunction`](README.md#messageclosefunction) |
| `messageStart` | [`MessageStartFunction`](README.md#messagestartfunction) |
| `sessionReplayStart` | [`SessionReplayStartFunction`](README.md#sessionreplaystartfunction) |
| `sessionReplayStop` | [`SessionReplayStopFunction`](README.md#sessionreplaystopfunction) |
| `surveyClose` | [`SurveyCloseFunction`](README.md#surveyclosefunction) |
| `surveyStart` | [`SurveyStartFunction`](README.md#surveystartfunction) |
| `targetingCheck` | [`TargetingCheckFunction`](README.md#targetingcheckfunction) |
Expand Down Expand Up @@ -560,6 +564,54 @@ Properties of Screeb provider

___

### SessionReplayStartFunction

Ƭ **SessionReplayStartFunction**: () => `Promise`\<`unknown`\>

Starts a session replay.

**`Example`**

```ts
const { sessionReplayStart } = useScreeb();

sessionReplayStart();
```

#### Type declaration

▸ (): `Promise`\<`unknown`\>

##### Returns

`Promise`\<`unknown`\>

___

### SessionReplayStopFunction

Ƭ **SessionReplayStopFunction**: () => `Promise`\<`unknown`\>

Interrupts a running session replay.

**`Example`**

```ts
const { sessionReplayStop } = useScreeb();

sessionReplayStop();
```

#### Type declaration

▸ (): `Promise`\<`unknown`\>

##### Returns

`Promise`\<`unknown`\>

___

### SurveyCloseFunction

Ƭ **SurveyCloseFunction**: () => `Promise`\<`unknown`\>
Expand Down
18 changes: 18 additions & 0 deletions packages/screeb-sdk-react/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,20 @@ export const ScreebProvider: React.FC<
[],
);

const sessionReplayStop = React.useCallback(
async () =>
await ensureScreeb("sessionReplayStop", () => Screeb.sessionReplayStop()),
[],
);

const sessionReplayStart = React.useCallback(
async () =>
await ensureScreeb("sessionReplayStart", () =>
Screeb.sessionReplayStart(),
),
[],
);

const targetingCheck = React.useCallback(
async () =>
await ensureScreeb("targetingCheck", () => Screeb.targetingCheck()),
Expand Down Expand Up @@ -292,6 +306,8 @@ export const ScreebProvider: React.FC<
surveyStart,
messageClose,
messageStart,
sessionReplayStop,
sessionReplayStart,
targetingCheck,
targetingDebug,
}),
Expand All @@ -311,6 +327,8 @@ export const ScreebProvider: React.FC<
surveyStart,
messageClose,
messageStart,
sessionReplayStop,
sessionReplayStart,
targetingCheck,
targetingDebug,
],
Expand Down
26 changes: 26 additions & 0 deletions packages/screeb-sdk-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ export type MessageStartFunction = (
language?: string,
) => Promise<unknown>;

/**
* Interrupts a running session replay.
*
* @example
* ```ts
* const { sessionReplayStop } = useScreeb();
*
* sessionReplayStop();
* ```
*/
export type SessionReplayStopFunction = () => Promise<unknown>;

/**
* Starts a session replay.
*
* @example
* ```ts
* const { sessionReplayStart } = useScreeb();
*
* sessionReplayStart();
* ```
*/
export type SessionReplayStartFunction = () => Promise<unknown>;

/**
* Forces a targeting check.
*
Expand Down Expand Up @@ -445,6 +469,8 @@ export type ScreebContextValues = {
surveyStart: SurveyStartFunction;
messageClose: MessageCloseFunction;
messageStart: MessageStartFunction;
sessionReplayStart: SessionReplayStartFunction;
sessionReplayStop: SessionReplayStopFunction;
targetingCheck: TargetingCheckFunction;
targetingDebug: TargetingDebugFunction;
};
Expand Down