How to use @aws-amplify/pubsub - 2 common examples

To help you get started, we’ve selected a few @aws-amplify/pubsub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / aws-builders-fair-projects / reinvent-2019 / drone-zone / react-ui / src / dashboard / dashboard.js View on Github external
import React from 'react';
import Amplify, { Auth, PubSub } from 'aws-amplify';
import IoT from 'aws-sdk/clients/iot';
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
import Highcharts from 'highcharts'
import HighchartsReact from 'highcharts-react-official'
import { Grid, Segment, Button, Statistic, Header, Table, Dropdown, Icon } from 'semantic-ui-react'
import { toast } from 'react-semantic-toasts';
import Config from '../config';

var subscriptions = []

// Apply plugin with configuration
Amplify.addPluggable(new AWSIoTProvider({
    aws_pubsub_region: Config.region,
    aws_pubsub_endpoint: Config.wss_endpoint,
}));

class Dashboard extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            telemetry: {},
            name: this.props.name,
            thingName: this.props.thingName,
            message: 'iVBORw0KGgoAAAANSUhEUgAAAoAAAAFoCAYAAADHMkpRAAAKQWlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0WAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZmBEf4RALU/L09mZmoSMaz9u4ugGS72yy/UCZz1v9/kSI3QyQGAApF1TY8fiYX5QKUU7PFGTL/BMr0lSkyhjEyFqEJoqwi48SvbPan5iu7yZiXJuShGlnOGbw0noy7UN6aJeGjjAShXJgl4GejfAdlvVRJmgDl9yjT0/icTAAwFJlfzOcmoWyJMkUUGe6J8gIACJTEObxyDov5OWieAHimZ+SKBIlJYqYR15hp5ejIZvrxs1P5YjErlMNN4Yh4TM/0tAyOMBeAr2+WRQ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iAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJmAADhZwXWXAAECBAgQICAAGgMECBAgQIAAgckEBMDJCq67BAgQIECAAAEB0BggQIAAAQIECEwmIABOVnDdJUCAAAECBAgIgMYAAQIECBAgQGAyAQFwsoLrLgECBAgQIEBAADQGCBAgQIAAAQKTCQiAkxVcdwkQIECAAAECAqAxQIAAAQIECBCYTEAAnKzgukuAAAECBAgQEACNAQIECBAgQIDAZAIC4GQF110CBAgQIECAgABoDBAgQIAAAQIEJhMQACcruO4SIECAAAECBARAY4AAAQIECBAgMJnA5yfrr+4SuPIC//nPfxZ//etfu/348pe/vPj85/f/P+uPPvpo8fHHH39mn/fee+/igQce+EzbLv/I9v785z8vPvzww8U//vGPxb/+9a/Ffffdt/jiF7+4ePTRRxcPPvjgLps7mWVTm7/97W9n//39738/61fq8qUvfWmRz/vvv3/xhS98Ye/He+hxMWq99l4IGyRwRQT2/01xRTruMAlcVYHf//73i1u3bp07/M997nOLl1566Vz73TYk0PzsZz87t5kEmRdffPFc+zYN77///uI3v/nNWfDrLf+73/3uLFzeuHHjLDD1ljm1tgSwX//614vbt2+fO7SE3Dbdc889i+vXry+uXbu2yN/7mg45Lkas177cbYfAVRVwCfiqVs5xTymQkPGHP/yh2/ennnpqkRC47ynBYp9Tjv+NN94ow1/b11/+8pez4JmzhKc+JST/9Kc/7Ya/1WPPmbS333578frrr5+dHVydf5F/H3JcjFivixhbh8BoAgLgaBXVn6EF3nvvvcW///3vc31M8MsZpX1P//znPxd//OMf97bZP/3pT2dnybbd4H//+9+zsJhLqac6JdAl0O56jB988MHitddeO3dp/SL9PNS4GLFeF/G1DoERBQTAEauqT0MKJAzl0mhvSvg7xL1/OfuTgLOPKcefS6S7T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QTIECAAAECBEYVEABHrax+ESBAgAABAgQKAQGwgNFMgAABAgQIEBhVQAActbL6RYAAAQIECBAoBATAAkYzAQIECBAgQGBUAQFw1MrqFwECBAgQIECgEBAACxjNBAgQIECAAIFRBQTAUSurXwQIECBAgACBQkAALGA0EyBAgAABAgRGFRAAR62sfhEgQIAAAQIECgEBsIDRTIAAAQIECBAYVUAAHLWy+kWAAAECBAgQKAQEwAJGMwECBAgQIEBgVAEBcNTK6hcBAgQIECBAoBAQAAsYzQQIECBAgACBUQUEwFErq18ECBAgQIAAgUJAACxgNBMgQIAAAQIERhUQAEetrH4RIECAAAECBAoBAbCA0UyAAAECBAgQGFVAABy1svpFgAABAgQIECgEBMACRjMBAgQIECBAYFQBAXDUyuoXAQIECBAgQKAQEAALGM0ECBAgQIAAgVEFBMBRK6tfBAgQIECAAIFCQAAsYDQTIECAAAECBEYVEABHrax+ESBAgAABAgQKAQGwgNFMgAABAgQIEBhVQAActbL6RYAAAQIECBAoBATAAkYzAQIECBAgQGBUAQFw1MrqFwECBAgQIECgEBAACxjNBAgQIECAAIFRBQTAUSurXwQIECBAgACBQkAALGA0EyBAgAABAgRGFRAAR62sfhEgQIAAAQIECgEBsIDRTIAAAQIECBAYVUAAHLWy+kWAAAECBAgQKAQEwAJGMwECBAgQIEBgVAEBcNTK6hcBAgQIECBAoBAQAAsYzQQIECBAgACBUQUEwFErq18ECBAgQIAAgUJAACxgNBMgQIAAAQIERhUQAEetrH4RIECAAAECBAoBAbCA0UyAAAECBAgQGFVAABy1svpFgAABAgQIECgEBMACRjMBAgQIECBAYFQBAXDUyuoXAQIECBAgQKAQEAALGM0ECBAgQIAAgVEFBMBRK6tfBAgQIECAAIFCQAAsYDQTIECAAAECBEYVEABHrax+ESBAgAABAgQKAQGwgNFMgAABAgQIEBhVQAActbL6RYAAAQIECBAoBATAAkYzAQIECBAgQGBUAQFw1MrqFwECBAgQIECgEBAACxjNBAgQIECAAIFRBQTAUSurXwQIECBAgACBQkAALGA0EyBAgAABAgRGFRAAR62sfhEgQIAAAQIECgEBsIDRTIAAAQIECBAYVUAAHLWy+kWAAAECBAgQKAQEwAJGMwECBAgQIEBgVAEBcNTK6hcBAgQIECBAoBAQAAsYzQQIECBAgACBUQUEwFErq18ECBAgQIAAgUJAACxgNBMgQIAAAQIERhUQAEetrH4RIECAAAECBAoBAbCA0UyAAAECBAgQGFVAABy1svpFgAABAgQIECgEBMACRjMBAgQIECBAYFQBAXDUyuoXAQIECBAgQKAQEAALGM0ECBAgQIAAgVEFBMBRK6tfBAgQIECAAIFCQAAsYDQTIECAAAECBEYVEABHrax+ESBAgAABAgQKAQGwgNFMgAABAgQIEBhVQAActbL6RYAAAQIECBAoBATAAkYzAQIECBAgQGBUAQFw1MrqFwECBAgQIECgEBAACxjNBAgQIECAAIFRBQTAUSurXwQIECBAgACBQkAALGA0EyBAgAABAgRGFRAAR62sfhEgQIAAAQIECgEBsIDRTIAAAQIECBAYVUAAHLWy+kWAAAECBAgQKAQEwAJGMwECBAgQIEBgVAEBcNTK6hcBAgQIECBAoBAQAAsYzQQIECBAgACBUQUEwFErq18ECBAgQIAAgUJAACxgNBMgQIAAAQIERhUQAEetrH4RIECAAAECBAoBAbCA0UyAAAECBAgQGFVAABy1svpFgAABAgQIECgEBMACRjMBAgQIECBAYFQBAXDUyuoXAQIECBAgQKAQEAALGM0ECBAgQIAAgVEFBMBRK6tfBAgQIECAAIFCQAAsYDQTIECAAAECBEYVEABHrax+ESBAgAABAgQKAQGwgNFMgAABAgQIEBhVQAActbL6RYAAAQIECBAoBATAAkYzAQIECBAgQGBUAQFw1MrqFwECBAgQIECgEBAACxjNBAgQIECAAIFRBf4P5ZE/BEkeK48AAAAASUVORK5CYII=',
            reported: {},
            chartOptions: {
                title: {
                    text: null
github aws-samples / connected-drink-dispenser-workshop / dispenser_app / src / main.js View on Github external
API: {
    endpoints: [
      {
        name: "CDD_API",
        endpoint: awsconfig.cdd_api_endpoint,
        custom_header: async () => {
          // NOTE: The Id token is used instead of the access token since we cannot use CloudFormation
          // to add the resource server configuration and scopes directly. TODO: monitor CloudFormation
          // and CDK support to add
          return { Authorization: `Bearer ${(await Auth.currentSession()).getIdToken().getJwtToken()}` }
        }
      },
    ]
  }
})
Amplify.addPluggable(new AWSIoTProvider({
  aws_pubsub_region: awsconfig.aws_cognito_region,
  aws_pubsub_endpoint: 'wss://' + awsconfig.aws_iot_endpoint + '/mqtt',
}));

// Setup a separate Vue instance for messages
export const bus = new Vue();

Vue.use(AmplifyPlugin, API, Auth)
// It's important that you instantiate the Vue instance after calling Vue.use!
new Vue({
  store,
  router,
  vuetify,
  render: h => h(App)
}).$mount('#app')

@aws-amplify/pubsub

Pubsub category of aws-amplify

Apache-2.0
Latest version published 8 days ago

Package Health Score

98 / 100
Full package analysis

Popular @aws-amplify/pubsub functions

Similar packages