0.0.5 • Published 3 years ago

robin.io-vue v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

About

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

Installation

## npm
npm install robin.io-vue

## yarn
yarn add robin.io-vue

Usage

import Vue from 'vue'
import App from './App.vue'
import RobinChat from 'robin.io-vue'
import 'robin.io-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

AttributeTypeDefaultDescription
api-keyString''SDK Authorization. (required)
user-tokenString''User Authorization. (required)
user-nameString''Name of the current user using Robin. (required)
usersArray[]User list - Data should model the keys option (required)
keysObject{}User data structure you want Robin to pull from. (required)
page-loaderBooleanTrueShows a loader when first mounting Component.

License

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