
---

## Generate document
---
This method generates the document that is defined for the provided slug. Inserts are processed.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.13.0 | 5.5.0 | 0.17.0 | 0.6.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_SCHEMA_READ` permission from the **Schema** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[Document](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#document)

**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public generateDocument(slug: string, onSuccess: (document: Document) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **slug** | string | yes | - | Slug of a document |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1170">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1170-0" data-tab-group="tabgrp-1170" data-tab-active="true">TypeScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1170-0" data-tab-group="tabgrp-1170" data-tab-active="true">

```TypeScript
Synerise.Content.generateDocument('slugName', function(document) {
    //success
}, function(error) {
    //failure
})
```

</div>
</div>
 

## Generate document with query parameters
---
This method generates the document that is defined for the parameters provided in the query object.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.18.0 | 5.19.0 | 0.22.0 | 1.2.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_SCHEMA_READ` permission from the **Schema** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[DocumentApiQuery](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#documentapiquery)  
[Document](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#document)

**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public generateDocumentWithApiQuery(apiQuery: DocumentApiQuery, onSuccess: (document: Document) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [DocumentApiQuery](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#document) | yes | - | Object that stores all query parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1171">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1171-0" data-tab-group="tabgrp-1171" data-tab-active="true">TypeScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1171-0" data-tab-group="tabgrp-1171" data-tab-active="true">

```TypeScript
let apiQuery = new DocumentApiQuery('SLUG');
documentApiQuery.productId = "PRODUCT_ID";

Synerise.Content.generateDocumentWithApiQuery(apiQuery, function(document) {
    //success
}, function(error) {
    //failure
})
```

</div>
</div>


## Get recommendations (v2)
---
This method generates recommendations that are defined for the options provided. The recommendations are generated by using a document with an insert.  

For instructions, see ["Displaying AI recommendations > With documents and screen views"](/developers/mobile-sdk/displaying-recommendations/documents).
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.13.0 | 5.5.0 | 0.17.0 | 0.6.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_SCHEMA_READ` permission from the **Schema** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[RecommendationOptions](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#recommendationoptions)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getRecommendationsV2(options: RecommendationOptions, onSuccess: (recommendationResponse: RecommendationResponse) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **recommendationOptions** | [RecommendationOptions](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#recommendationoptions) | yes | - | Object for configuration of the options parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1172">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1172-0" data-tab-group="tabgrp-1172" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1172-0" data-tab-group="tabgrp-1172" data-tab-active="true">

```JavaScript
let recommendationOptions = new RecommendationOptions()
recommendationOptions.productID = 'productID'
recommendationOptions.slug = 'slugName'
Synerise.Content.getRecommendationsV2(recommendationOptions, function(recommendationResponse) {
      //success
},function(error) {
      //failure
});
```

</div>
</div>
 

## Generate screen View
---
This method generates a customer's highest-priority screen view campaign from the feed with the provided feed slug.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.13.0 | 5.5.0 | 0.17.0 | 0.6.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_SCHEMA_READ` permission from the **Schema** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[ScreenView](/developers/mobile-sdk/class-reference/react-native/miscellaneous#screenview)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public generateScreenView(feedSlug: string, onSuccess: (screenView: ScreenView) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **feedSlug** | string | yes | - | Identifies a specific screen view feed |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned. 

## Generate screen view with query parameters
---
This method generates customer's highest-priority screen view campaign that is defined for parameters provided in the query object.
**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[ScreenViewApiQuery](/developers/mobile-sdk/class-reference/react-native/miscellaneous#screenviewapiquery)
[ScreenView](/developers/mobile-sdk/class-reference/react-native/miscellaneous#screenview)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public generateScreenViewWithApiQuery(apiQuery: ScreenViewApiQuery, onSuccess: (screenView: ScreenView) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [ScreenViewApiQuery](/developers/mobile-sdk/class-reference/react-native/miscellaneous#screenviewapiquery) | yes | - | Object that stores all query parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1173">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1173-0" data-tab-group="tabgrp-1173" data-tab-active="true">TypeScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1173-0" data-tab-group="tabgrp-1173" data-tab-active="true">

```TypeScript
let apiQuery = new ScreenViewApiQuery("FEED_SLUG", "PRODUCT_ID");

Synerise.Content.generateScreenViewWithApiQuery(apiQuery, function(screenView) {
    //success
},function(error) {
    //failure
})
```

</div>
</div>
 

## Generate Brickworks
---
This method generates content from a published version of a [Brickworks](/docs/assets/brickworks) record. Inserts and fields which require a customer context fetch it automatically from the current user.



|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 5.8.1        | 6.8.0           | 1.6.0                | 2.6.0            |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `BRICKWORKS_RECORDS_READ` permission from the **RECORDS** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js

**Related To:**  
[BrickworksApiQuery](/developers/mobile-sdk/class-reference/react-native/miscellaneous#brickworksapiquery)

**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)

**Declaration:**  

<pre><code class="language-ts">public generateBrickworks(apiQuery: BrickworksApiQuery, onSuccess: (brickWorks: object) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [BrickworksApiQuery](/developers/mobile-sdk/class-reference/react-native/miscellaneous#brickworksapiquery) | yes | - | Object with all query parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
Object with content generated from a record.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1174">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1174-0" data-tab-group="tabgrp-1174" data-tab-active="true">TypeScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1174-0" data-tab-group="tabgrp-1174" data-tab-active="true">

```TypeScript
let apiQuery = new BrickworksApiQuery("SCHEMA_SLUG", "RECORD_SLUG");

Synerise.Content.generateBrickworksWithApiQuery(apiQuery, function(brickworks) {
    //success
},function(error) {
    //failure
})
```

</div>
</div>
 

## Removed methods

### <del>Get document</del> {#get-document}
---
This method generates the document that is defined for the provided slug.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.4.8 | 3.4.2 | 0.9.10 | 0.2.0 |
| <span style="color:orange">Deprecated in:</span> | 4.13.0 | 5.5.0 | 0.17.0 | 0.6.0 |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_DOCUMENT_READ` permission from the **Document** group.

</div></div></div>

**Replaced By:**  
[Generate document](/developers/mobile-sdk/method-reference/react-native/content#generate-document) and [Generate document with query parameters](/developers/mobile-sdk/method-reference/react-native/content#generate-document-with-query-parameters)

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getDocument(slug: string, onSuccess: (document: Object) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **slug** | string | yes | - | Slug of a document |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1175">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1175-0" data-tab-group="tabgrp-1175" data-tab-active="true">TypeScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1175-0" data-tab-group="tabgrp-1175" data-tab-active="true">

```TypeScript
Synerise.Content.getDocument('slugName', function(document) {
    //success
}, function(error) {
    //failure
})
```

</div>
</div>
 

### <del>Get documents</del> {#get-documents}
---
This method generates documents that are defined for parameters provided in the query object.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_DOCUMENT_READ` permission from the **Document** group.

</div></div></div>

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[DocumentsApiQuery](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#documentsapiquery)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getDocuments(apiQuery: DocumentsApiQuery, onSuccess: (documents: Array&lt;Object&gt;) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **documentsApiQuery** | [DocumentsApiQuery](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#documentsapiquery) | yes | - | [DocumentsApiQuery](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#documentsapiquery) object responsible for storing all query parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1176">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1176-0" data-tab-group="tabgrp-1176" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1176-0" data-tab-group="tabgrp-1176" data-tab-active="true">

```JavaScript
let documentsApiQuery = new DocumentsApiQuery(DocumentsApiQueryType.SCHEMA, 'type', '1.0.0')
Synerise.Content.getDocuments(documentsApiQuery, function(documents) {
     //success
}, function(error) {
     //failure
 })
```

</div>
</div>
 

### <del>Get recommendations</del> {#get-recommendations}
---
This method generates recommendations that are defined for the options provided.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_DOCUMENT_READ` permission from the **Document** group.

</div></div></div>

**Replaced By:**  
[Get recommendations (v2)](/developers/mobile-sdk/method-reference/react-native/content#get-recommendations-v2)

**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[RecommendationOptions](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#recommendationoptions)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getRecommendations(options: RecommendationOptions, onSuccess: (recommendationResponse: RecommendationResponse) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **recommendationOptions** | [RecommendationOptions](/developers/mobile-sdk/class-reference/react-native/recommendations-and-documents#recommendationoptions) | yes | - | Object for configuration of the options parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1177">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1177-0" data-tab-group="tabgrp-1177" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1177-0" data-tab-group="tabgrp-1177" data-tab-active="true">

```JavaScript
let recommendationOptions = new RecommendationOptions()
recommendationOptions.productID = 'productID'
recommendationOptions.slug = 'slugName'
Synerise.Content.getRecommendations(recommendationOptions, function(recommendationResponse) {
      //success
},function(error) {
      //failure
});
```

</div>
</div>
 

### <del>Get screen View</del> {#get-screen-view}
---
This method generates the customer's highest-priority screen view campaign.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.1 | 3.7.1 | 0.9.10 | 0.2.0 |
| <span style="color:orange">Deprecated in:</span> | 4.13.0 | 5.5.0 | 0.17.0 | 0.6.0 |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SCHEMA_SERVICE_SCHEMA_READ` permission from the **Schema** group.

</div></div></div>

**Replaced By:**  
[Generate screen view](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view) and [Generate screen view with query parameters](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view-with-query-parameters)


**Declared In:**  
lib/main/modules/ContentModule.js
  
**Related To:**  
[ScreenViewResponse](/developers/mobile-sdk/class-reference/react-native/miscellaneous#screenviewresponse)
  
**Class:**  
[ContentModule](/developers/mobile-sdk/class-reference/react-native/modules#content)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getScreenView(onSuccess: (screenViewResponse: ScreenViewResponse) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned. 