Getting Started

Browse through ReachFive Core SDK JS methods. All methods return Promises.

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

The latest release is available via npm install @reachfive/identity-core and on unpkg.

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 Client ID.

  • You must whitelist all available domains where the ReachFive SDK will be used.

    This is done in the Allowed Origins (CORS) field of your ReachFive console, in the Settings menu.

The ReachFive client detects the user locale from the browser. You can override this at initialization by providing a language.

Currently, we support:

  • de - Deutsch

  • en - English

  • es - Español

  • fr - Français

  • it - Italiano

  • nl - Nederlands

  • ru - Ру́сский (Russian)

Installation

The SDK registers the reach5 global variable. Use the createClient method to initialize a ReachFive client.

  • Node

  • CDN

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

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

const client = reach5.createClient({
    // Required parameters
    domain: DOMAIN,
    clientId: CLIENT_ID,
    // Optional parameter
    language: 'Here paste a language code'
});
const DOMAIN        = 'Here paste your ReachFive domain';
const CLIENT_ID     = 'Here paste your ReachFive client ID';

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

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