Skip to content

robin-io/robin-vue

Repository files navigation

robin-vue

Table of Contents
  1. About
  2. Installation
  3. Usage
  4. Available options
  5. License

About

robin-vue is a Vue SDK built to communicate with the Robin API. Now you can integrate Robin with minimal effort and quickly setup an real-time messaging platform in your Vue.js web application.

Installation

## npm
npm install robin-vue

## yarn
yarn add robin-vue

Usage

import Vue from 'vue'
import App from './App.vue'
import RobinChat from 'robin-vue'
import 'robin-vue-sdk/dist/style.css'

Vue.config.productionTip = false

Vue.use(RobinChat)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
<template>
  <div id="app">
    <RobinChat :api-key="apiKey" :user-token="userToken" :user-name="userName" :users="users" :keys="keys" :page-loader="pageLoader" />
  </div>
</template>

<script>

export default {
  name: 'ChatApp',
  components: {
    RobinChat
  },
  data () {
    return {
      apiKey: '...'
      userToken: '...
      pageLoader: true,
      userName: '...',
      keys: {
        userToken: 'user_token',
        profileImage: 'profile_image',
        userName: 'fullname'
      },
      users: [{
        userToken: '...',
        profileImage: '...',
        userName: '...'
      }]
    }
  }
}
</script>

Available options

Attribute Type Default Description
api-key String '' SDK Authorization. (required)
user-token String '' User Authorization. (required)
user-name String '' Name of the current user using Robin. (required)
users Array [] User list - Data should model the keys option (required)
keys Object {} User data structure you want Robin to pull from. (required)
page-loader Boolean True Shows a loader when first mounting Component.

License

Distributed under the MIT License. See LICENSE for more information.