---
title: Advanced features
source: https://docs.newrelic.com/docs/browser/browser-monitoring/browser-pro-features/session-replay/advanced-features
---

## Manually record session replays [#manual-replays]

If needed, you can programmatically `force` a session replay to start or stop recording using API methods. Here are some use cases:

-   Allow users to opt in for interaction recording. For example, if you have a pop-up asking "Allow this session to be recorded for performance analysis?" and a user consents:
    1.  Call `newrelic.recordReplay()`, to initiate recording.
    2.  After the session is complete or consent is withdrawn, use `newrelic.pauseReplay()` to stop capturing data.
-   Record sessions based on specific criteria, such as:
    -   Start recording only for sessions on specific URLs such as a product checkout flow.
    -   Stop recording for sensitive pages such as `/billing` or `/health-records`.

Refer the API documentation for instructions:

-   [`newrelic.recordReplay`](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordReplay/)
-   [`newrelic.pauseReplay`](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/pauseReplay/)

## Disable automatic session replay tracking [#auto-replays]

You can prevent session replays from automatically starting, even when sampled, by setting the API configuration option `autoStart` to `false`. This is useful in scenarios where you need to prioritize specific actions over automatic sampling. For example, you might not want session replays to automatically run on sensitive pages, like HIPAA-compliant ones. In such cases, you can use the `.start()` API to manually trigger the replay feature after user consent is obtained (and your app calls `.start()`)

Setting `autoStart: false` instructs the agent to defer its initialization until explicitly called using `.start()`. This ensures that session replays won't be created at all, even if the backend samples your application for recording.

> #### ⚠️ IMPORTANT
>
> Calling `.start()` doesn't guarantee that a session replay will be recorded. It simply delays the module import and evaluation of sampling results until this point. If you need to force a recording, refer [Manually record session replays](#manual-replays).

To start using this API, refer [`newrelic.start`](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/start/).

## Use Nerdgraph to configure replay settings [#nerdgraph-mutation]

You can configure session replay settings using our [NerdGraph API](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/) instead of using the UI. This method is helpful if you need to make bulk changes, such as applying sampling rates to multiple browser entities.

Here's an example mutation and variables to create a new browser application with default settings:

| Mutation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Variables                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ````graphql mutation SessionReplayConfigUpdate($guid: EntityGuid!, $settings: AgentApplicationSettingsUpdateInput!) {   agentApplicationSettingsUpdate(guid: $guid, settings: $settings) {     browserSettings {       sessionReplay {         blockSelector         errorSamplingRate         maskTextSelector         enabled         collectFonts         inlineImages         inlineStylesheet         samplingRate         maskAllInputs         maskInputOptions {           color           date           datetimeLocal           email           month           number           range           search           select           tel           text           textArea           time           url           week         }       }     }     errors {       field       errorClass       description     }   } } ```  ```` | ````json {   "sessionReplay": {     "enabled": true,     "collectFonts": true,     "blockSelector": ".private-fields",     "maskTextSelector": "*",     "inlineStylesheet": false,     "maskAllInputs": true,     "maskInputOptions": {       "color": true,       "date": true,       "textArea": true     },     "samplingRate": 9.99,     "errorSamplingRate": 1.11   } } ```  ```` |
