npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eyeone-node-sdk

v0.6.16

Published

EyeOne customer API SDK

Downloads

3

Readme

EyeOne SDK Library

Version Downloads

EyeOne SDK library provides access to the EyeOne API from server-side applications written in JavaScript.

Documentation

Documentation is currently in progress.

Requirements

Node 10 or higher.

Installation

You can install EyeOne SDK with:

npm install eyeone-node-sdk --save

Usage

Import/require

You need valid api key and secret token from your Eye One account in order to properly configure this package. You can obtain your keys at app.eye.one/api-settings.

You need to define an origin as well. Origin is a custom name that will be added to resources created by external API. For example if you will define origin [MY_APP], then you will be able to filter out chat conversations, invitations or appointments by this tag in EyeOne dashboard.

Require eyeone-node-sdk with api key, secret and origin:

const EyeOne = require("eyeone-node-sdk")("ef7ce...", "NzAs4G/...", "MY_APP", config);

EyeOne.Appointments.slots({ appointmentTypeHash })
  .then((slots) => {
    console.log(slots);
  })
  .catch((error) => console.error(error));

or with async/await:

const EyeOne = require("eyeone-node-sdk")("ef7ce...", "NzAs4G/...", "MY_APP", config);

async getAppointmentSlots(appointmentTypeHash) {
    try {
      const slots = await EyeOne.Appointments.slots({ appointmentTypeHash });
      return slots;
    } catch (error) {
      throw new EyeOneError(error);
    }
  }

Configuration object

You can define config object and set parameters from the list below:

| Parameter | Default | Description | | ------------- | ----------------------- | ------------------------------------------------------------------------------------- | | host | 'https://app.eye.one' | EyeOne API host. Mostly used for development if API is hosted locally or at dev site. | | debug | false | Shows logs in console. | | development | false | If set to true then it does not check url validity (i.e. localhost:8000). |

Available resources

Not all resources are available via external api and this package.

Appointments / invitations

Get all appointment types

You can get all appointment types by using your email.

const appointments = await EyeOne.Appointments.types({
  email
});

Get slots for appointment type

You can get available slots for your appointment by using a hash of your appointment type, you can copy it from scheduling settings at app.eye.one:

const slots = await EyeOne.Appointments.slots({ appointmentTypeHash });

Get all invitations/appointments

You can get all of invitations by using your: email (or your guest email), is_eye_one_user (if you are active EyeOne user specify as true) type (can be created (for invited guests), completed (for ended invitations) or confirmed (waiting for a call))

You can use page and limit to properly paginate through all invitations.

const appointments = await EyeOne.Appointments.list({
  email,
  is_eye_one_user,
  type,
  page,
  limit
});

Create appointment/invitation

You can create new invitation by using: start_date (which is one of the slots supplied by previous endpoint), timezone (guest timezone, used for properly setting timezones), hash (appointment type hash), email (guest email), name(guest name).

const newAppointment = await EyeOne.Appointments.create({
  start_date,
  timezone,
  hash: appointmentTypeHash,
  email: user.email,
  name: `${user.firstName} ${user.lastName}`
});

Chat conversations

Creating conversation

Chat conversations at EyeOne can be created by EyeOne user or by a guest. In order to properly start a conversation, you need to provide: caller_email (who is starting a chat), receiver_email (Who is being written to), first_name, last_name, is_eye_one_user (if you are active EyeOne user specify as true)

const conversation = await EyeOne.Chat.create({
  caller_email,
  receiver_email,
  first_name,
  last_namee,
  is_eye_one_user
});

Get all conversations

You can list all conversations for a given user, by using: email (who is requesting conversations list), is_eye_one_user (if you are active EyeOne user specify as true) show_team (show your team members conversations as well),

const conversations = await EyeOne.Chat.list({
  email,
  is_eye_one_user,
  show_team
});

Get single conversation with messages

Chat conversations at EyeOne can be created by EyeOne user or by a guest. In order to properly start a conversation, you need to provide: conversationHash (conversation hash, can be obtained by creating new conversation or by a list), email (who is requesting this conversation)

You can use page and limit to properly paginate through all invitations.

const conversation = await EyeOne.Chat.get({
  conversationHash,
  email,
  page,
  limit
});

Status

Get user status

You can get user availability (is logged into Eye One or not?) and name.

const user = await EyeOne.Status.user({
  email
});

Widgets

Get widgets list

You can get all user's widgets.

const user = await EyeOne.Widgets.list({
  email
});