> ## Documentation Index
> Fetch the complete documentation index at: https://docs.algoreg.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started

> Integrate Algoreg Go!Vid in your own application

## Process overview

Go!Vid is a fully automated solution to verify the identity of your end users. The integration web based and can then be integrated in an iframe or a webview or by redirecting the end user.

There is an overview of a basic integration workflow with Go!Vid. Of course we can define other workflows, with or without human agents to validate the sessions, with or without accessing the session details, with customized UI and more.

<AccordionGroup>
  <Accordion title="Generate the session" icon="circle-1">
    Generate an onboarding session url for a customer (see [API
    reference](/api-reference/go-vid/create-session))
  </Accordion>

  <Accordion title="Redirect user to the session" icon="circle-2">
    Redirect the customer to this url (send the url by sms, HTTP redirection, or
    open an iframe)
  </Accordion>

  <Accordion title="Get notified when the session ends" icon="circle-3">
    At the end of the session, we redirect the user to a page you define or we
    let you close the iframe. You also get a webhook notification to inform your
    server that a session just ended or when an agent change the decision of a
    session. (see [API reference](/api-reference/go-vid/webhooks))
  </Accordion>

  <Accordion title="Obtain the session results" icon="circle-4">
    In any cases, call our APIs to get more details about the finished session
    (see [API reference](/api-reference/go-vid/get-session))
  </Accordion>
</AccordionGroup>

## Prerequisites

To use Go!Vid, first check that you have access to this product on the Algoreg backoffice, you can verify this in the billing page.

Make sure you:

* [did define a first scenario](/docs/govid/scenarios)
* [know ho to generate a session using the API](/api-reference/go-vid/create-session).

Optionally, you may also want to:

* [define status](/docs/govid/status) that the robot and your agents will be able to affect to the session.
* [create a customer](/docs/customers) if you want your session attached to a customer.
* [configure a webhook](/api-reference/go-vid/webhooks) to be notified when a session is completed.

## Integration

After generating the session you will get a `session_id` string that you can use as described bellow either in an iframe or redirection.

### Use a redirection

Simply redirect the user to the following url:

```
https://vid.algoreg.com/?session_id={session_id}
# Or https://vid.{instance}.algoreg.com/?session_id={session_id} if you're using a custom instance
```

### Use an iframe

The integration is using the same url than the redirection but with `&iframe_callback=1` to receive cross-windows events. To ensure that the iframe gets the video and microphone access, you need to add the following attributes to the iframe tag:

```jsx theme={null}
<iframe
  src="https://vid.algoreg.com/?session_id={session_id}&iframe_callback=1"
  allow="camera https://vid.algoreg.com; microphone https://vid.algoreg.com; geolocation https://vid.algoreg.com”
/>
```

The iframe will then send events to the parent window. You **must** handle them to correctly integrate the session.

```javascript theme={null}
window.addEventListener(
  "message",
  (msg) => {
    if (msg.data.event == "reload") {
      window.location.reload();
    }
    if (msg.data.event == "end_session") {
      console.log("The session ended");
    }
  },
  false
);
```

| Event         | Description                                                                             |
| ------------- | --------------------------------------------------------------------------------------- |
| `end_session` | The session is finished, you can close the iframe or redirect the user to another page. |
| `reload`      | We need to restart the browser, usually to get the camera access.                       |

## Session customization and accessibility

From the Algoreg backoffice panel, you can customize the CSS stylesheet of a scenario. You can also change all the texts from the session. In addition to this, you can specify some parameters directly into the url.

<ParamField path="show_consent" type="string" default="1">
  0 or 1. Enable or not the consent page.
</ParamField>

<ParamField path="show_ready" type="string" default="1">
  0 or 1. Enable or not the ready page.
</ParamField>

<ParamField path="use_speech" type="string" default="0">
  0 or 1. Enable or not the speech synthesis.
</ParamField>

<ParamField path="force_manual" type="string" default="0">
  0 or 1. Set to 1 to disable automatic speech recognition after speech. (The
  user will need to push the mic button)
</ParamField>

<ParamField path="ask_camera_access" type="string" default="1">
  0 or 1. Do not ask for camera access (only use this option if you do multiple
  scenario one after the other and that the camera access was already granted!)
</ParamField>

<ParamField path="show_final" type="string" default="1">
  0 or 1. Enable or not the final text page.
</ParamField>

<ParamField path="iframe_callback" type="string" default="0">
  0 or 1. Enable iframe callback. In this case we'll send an event to the parent
  window instead of redirecting user to another URL.
</ParamField>

<ParamField path="return_url" type="string">
  Specify a return\_url (override all previously defined return\_url) More about
  return url here
</ParamField>

<ParamField path="theme" type="string">
  `auto`,`light` or `dark`. Set the theme brightness. Use "auto" for automatic
  theme detection, "light" for a light theme, or "dark" for a dark theme.
</ParamField>

<ParamField path="powered_by" type="string">
  0 or 1. Enable the display of a block with your Algoreg Logo
</ParamField>

<script type="application/javascript">document.body.style.opacity = 0;</script>

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/decrypt.js" />

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/text-replace.js" />
