Initializing a Session

Use initialization methods to start a Bringg Dispatcher SDK session.

Overview

Before executing other Bringg Dispatcher SDK methods, initialize a session using the user email and password.

📘

You must initialize a Bringg Dispatcher SDK session.

Syntax

bringgDashboardSDK.initWithEmail(, )

where

  • email is the user login email address
  • password is the password for the login email address

Example

<!doctype html>
<html lang="en">
<head>
  <!-- ... -->
  <script src="/bringg-dashboard-sdk.js"></script>
</head>
<body>
<!-- ... -->
<script>
BringgDashboardSDK.initWithEmail(email, password).then(bringgDashboardSDK => {
  bringgDashboardSDK.users.getAll().then(console.log).catch(console.error);
});
</script> 
</body>
</html>
const BringgDashboardSDK = require("bringg-dashboard-sdk");

BringgDashboardSDK.initWithAuthToken(region, authToken).then(bringgDashboardSDK => {
  bringgDashboardSDK.users.getAll().then(console.log).catch(console.error);
});
import BringgDashboardSDK = require("bringg-dashboard-sdk");

async function runAwait() {
  
  try {
      const bringgDashboardSDK = await BringgDashboardSDK.initWithAuthToken(region, authToken);
      console.log(await bringgDashboardSDK.users.getAll());
    } catch (e) {
      console.error(e); 
    }
}

runAwait();

initWithEmail Method

Input Paramaters

email

string

REQUIRED

The email address of an authorized Bringg user.

password

string

REQUIRED

The password for the email address of the authorized Bringg user whose email is used to initialize the session.

region

Region

The region you received from Bringg for use with the Bringg Dispatcher SDK

Response

session

Bringg

A successful initialization opens a session in which you can execute Bringg SDK methods.