1.0.10 • Published 6 months ago

botbye-client v1.0.10

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

BotBye
DOCS

Install

npm i botbye-client

or

yarn add botbye-client

Usage

1. Import initChallenges from botbye-client module:

import {initChallenges} from "botbye-client";

2. Call initChallenges with your project client-key (available inside your Projects):

/**
 * @param {Object} options - The options for BotBye init
 * @return {Promise} - Promise with runChallenge function
 */
const runChallenge = await initChallenges({
            clientKey: '00000000-0000-0000-0000-000000000000' // Use your client-key
        });

3. To run challenge and generate BotBye token call runChallenge:

/**
 * @return {Promise} Promise with BotBye token
 */
const botByeToken = await runChallenge();

4. Send this token in any convenient way to the backend. For example in BotBye-Token header:

fetch('https://domain.com', {
  method: "POST",
  headers: {
    "BotBye-Token": botByeToken
  }
})

runChallenge()

Package also exports runChallenge function. Before call it, make sure that initChallenges was called earlier.

import {initChallenges, runChallenge} from "botbye-client";

initChallenges({
    clientKey: '00000000-0000-0000-0000-000000000000' // Use your client-key
});

...

runChallenge()
  .then((botByeToken) =>
    fetch('https://domain.com', {
      method: "POST",
      headers: {
        "BotBye-Token": botByeToken
      }
    }))
1.0.9

6 months ago

1.0.10

6 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

11 months ago

1.0.3

12 months ago

1.0.2

1 year ago

0.0.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago