Skip to content

Commit

Permalink
feat(*): force language
Browse files Browse the repository at this point in the history
  • Loading branch information
cley44 committed Oct 1, 2024
1 parent d258a16 commit e2f4b6c
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 267 deletions.
74 changes: 41 additions & 33 deletions packages/screeb-sdk-angular/docs/classes/Screeb.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@

### constructor

**new Screeb**(`config`)
**new Screeb**(`config`): [`Screeb`](Screeb.md)

#### Parameters

| Name | Type |
| :------ | :------ |
| `config` | [`ScreebConfig`](ScreebConfig.md) |

#### Returns

[`Screeb`](Screeb.md)

## Properties

### config
Expand All @@ -60,13 +64,13 @@ ___

### close

**close**(): `Promise`<`unknown`\>
**close**(): `Promise`\<`unknown`\>

Shutdowns current Screeb session.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -78,13 +82,13 @@ ___

### debug

**debug**(): `Promise`<`unknown`\>
**debug**(): `Promise`\<`unknown`\>

Prints the actual state information of Screeb tag.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand Down Expand Up @@ -113,7 +117,7 @@ ___

### ensureScreeb

`Private` **ensureScreeb**(`functionName`, `onlyLoaded?`): `Promise`<`void`\>
**ensureScreeb**(`functionName`, `onlyLoaded?`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -124,13 +128,13 @@ ___

#### Returns

`Promise`<`void`\>
`Promise`\<`void`\>

___

### eventTrack

**eventTrack**(`eventName`, `eventProperties?`): `Promise`<`unknown`\>
**eventTrack**(`eventName`, `eventProperties?`): `Promise`\<`unknown`\>

Tracks a user event.

Expand All @@ -143,7 +147,7 @@ Tracks a user event.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -168,7 +172,7 @@ ___

### identity

**identity**(`userId`, `userProperties?`): `Promise`<`unknown`\>
**identity**(`userId`, `userProperties?`): `Promise`\<`unknown`\>

Change the current user identity.
Warning: Running surveys will be closed.
Expand All @@ -182,7 +186,7 @@ Warning: Running surveys will be closed.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -203,13 +207,13 @@ ___

### identityGet

**identityGet**(): `Promise`<`ScreebIdentityGetReturn`\>
**identityGet**(): `Promise`\<`ScreebIdentityGetReturn`\>

Retrieves the current user identity.

#### Returns

`Promise`<`ScreebIdentityGetReturn`\>
`Promise`\<`ScreebIdentityGetReturn`\>

**`Example`**

Expand All @@ -230,7 +234,7 @@ ___

### identityGroupAssign

**identityGroupAssign**(`groupName`, `groupType?`, `groupProperties?`): `Promise`<`unknown`\>
**identityGroupAssign**(`groupName`, `groupType?`, `groupProperties?`): `Promise`\<`unknown`\>

Assigns the current user to a group.

Expand All @@ -244,7 +248,7 @@ Assigns the current user to a group.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -267,7 +271,7 @@ ___

### identityGroupUnassign

**identityGroupUnassign**(`groupName`, `groupType?`): `Promise`<`unknown`\>
**identityGroupUnassign**(`groupName`, `groupType?`): `Promise`\<`unknown`\>

Unassigns the current user to a group.

Expand All @@ -280,7 +284,7 @@ Unassigns the current user to a group.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -292,7 +296,7 @@ ___

### identityProperties

**identityProperties**(`userProperties`): `Promise`<`unknown`\>
**identityProperties**(`userProperties`): `Promise`\<`unknown`\>

Adds properties to the current user identity.

Expand All @@ -304,7 +308,7 @@ Adds properties to the current user identity.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand Down Expand Up @@ -334,14 +338,14 @@ ___

### identityReset

**identityReset**(): `Promise`<`unknown`\>
**identityReset**(): `Promise`\<`unknown`\>

Resets the current user identity.
Warning: This command must be called only once, since it creates a new identity on Screeb side.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -353,7 +357,7 @@ ___

### init

**init**(`websiteId`, `userId?`, `userProperties?`, `hooks?`): `Promise`<`unknown`\>
**init**(`websiteId`, `userId?`, `userProperties?`, `hooks?`, `language?`): `Promise`\<`unknown`\>

Initializes Screeb tag.

Expand All @@ -365,10 +369,11 @@ Initializes Screeb tag.
| `userId?` | `string` | The unique identifier of your user. |
| `userProperties?` | `PropertyRecord` | The properties of your user. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date ``` |
| `hooks?` | `Hooks` | - |
| `language?` | `string` | Force a specific language for the tag. eg: 'en'. default: browser language. |

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -387,14 +392,15 @@ this.screeb.init(
version: "1.0.0",
onReady: (payload) => console.log("Screeb SDK is ready!", payload),
},
"en"
);
```

___

### load

**load**(`options?`): `Promise`<`undefined`\>
**load**(`options?`): `Promise`\<`undefined`\>

Appends Screeb tag into your dom.

Expand All @@ -406,7 +412,7 @@ Appends Screeb tag into your dom.

#### Returns

`Promise`<`undefined`\>
`Promise`\<`undefined`\>

**`Example`**

Expand All @@ -418,13 +424,13 @@ ___

### surveyClose

**surveyClose**(): `Promise`<`unknown`\>
**surveyClose**(): `Promise`\<`unknown`\>

Interrupts a running survey.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -436,7 +442,7 @@ ___

### surveyStart

**surveyStart**(`surveyId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`): `Promise`<`unknown`\>
**surveyStart**(`surveyId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\>

Starts a survey by its ID.

Expand All @@ -448,10 +454,11 @@ Starts a survey by its ID.
| `allowMultipleResponses` | `boolean` |
| `hiddenFields` | `PropertyRecord` |
| `hooks?` | `Hooks` |
| `language?` | `string` |

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -467,20 +474,21 @@ this.screeb.surveyStart(
version: "1.0.0",
onSurveyShowed: (payload) => console.log("Survey showed", payload),
},
"en"
);
```

___

### targetingCheck

**targetingCheck**(): `Promise`<`unknown`\>
**targetingCheck**(): `Promise`\<`unknown`\>

Forces a targeting check.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand All @@ -492,13 +500,13 @@ ___

### targetingDebug

**targetingDebug**(): `Promise`<`unknown`\>
**targetingDebug**(): `Promise`\<`unknown`\>

Prints the current state of the targeting engine.

#### Returns

`Promise`<`unknown`\>
`Promise`\<`unknown`\>

**`Example`**

Expand Down
6 changes: 5 additions & 1 deletion packages/screeb-sdk-angular/docs/classes/ScreebConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Configuration of Screeb module

### constructor

**new ScreebConfig**()
**new ScreebConfig**(): [`ScreebConfig`](ScreebConfig.md)

#### Returns

[`ScreebConfig`](ScreebConfig.md)

## Properties

Expand Down
10 changes: 7 additions & 3 deletions packages/screeb-sdk-angular/docs/classes/ScreebModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

### constructor

**new ScreebModule**(`config`, `screeb`)
**new ScreebModule**(`config`, `screeb`): [`ScreebModule`](ScreebModule.md)

#### Parameters

Expand All @@ -25,11 +25,15 @@
| `config` | [`ScreebConfig`](ScreebConfig.md) |
| `screeb` | [`Screeb`](Screeb.md) |

#### Returns

[`ScreebModule`](ScreebModule.md)

## Methods

### forRoot

`Static` **forRoot**(`config`): `ModuleWithProviders`<[`ScreebModule`](ScreebModule.md)\>
**forRoot**(`config`): `ModuleWithProviders`\<[`ScreebModule`](ScreebModule.md)\>

This is used to initialize Screeb at the top of your Angular application

Expand All @@ -41,7 +45,7 @@ This is used to initialize Screeb at the top of your Angular application

#### Returns

`ModuleWithProviders`<[`ScreebModule`](ScreebModule.md)\>
`ModuleWithProviders`\<[`ScreebModule`](ScreebModule.md)\>

**`Example`**

Expand Down
Loading

0 comments on commit e2f4b6c

Please sign in to comment.