Getting Started

This is an alpha release. Please file new issues for any bugs you find in it.

Browse through ReachFive UI SDK JS methods. These methods alter the DOM, so a <div> must be provided with a specific id on your webpage.

Browser compatibility

The SDK is compatible with the latest versions of:

  • Edge,

  • Chrome,

  • Firefox,

  • Safari,

  • and IE 11.

Prerequisites

To initialize the ReachFive client, you need a Domain URL and a Client ID.

For more information, refer to Domain and client configuration.

For security reasons, you have to whitelist all available domains where the ReachFive SDK will be used. This has to be done in the Allowed Origins (CORS) field of your ReachFive console, in the Settings menu.

The ReachFive client detects the user locale from the browers', and you can override the local at intialization by providing a language. Supported languages are: en, es, fr, it, nl.

Installation

  1. You can install the latest release of the package via npm:

    npm install --save @reachfive/identity-ui
  2. You can also download and include with a script tag from the third-party unpkg CDN:

    <script src="https://unpkg.com/@reachfive/identity-ui@x.y.z/umd/identity-ui.min.js"></script>

    The SDK registers a reach5Widgets global variable in the window object.

Use the createClient method to initialize a ReachFive client.

  • Node

  • CDN

import { createClient } from '@reachfive/identity-ui';

const DOMAIN        = 'Here paste your ReachFive domain';
const CLIENT_ID     = 'Here paste your ReachFive client ID';

const client = createClient({
    domain: DOMAIN,
    clientId: CLIENT_ID,
    // Optional parameter
    language: 'Here paste a language code'
});
<script src="https://unpkg.com/@reachfive/identity-ui@x.y.z/umd/identity-ui.min.js"></script> (1)
<script type="text/javascript">
    const DOMAIN        = 'Here paste your ReachFive domain';
    const CLIENT_ID     = 'Here paste your ReachFive client ID';

    const client = reach5Widgets.createClient({
        domain: DOMAIN,
        clientId: CLIENT_ID,
        // Optional parameter
        language: 'Here paste a language code'
    });
</script>
1 Replace x.y.z by the specific version you require.

All code examples assume the ReachFive client was instantiated and stored in a variable named client.