Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-advanced-websocket-types

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-advanced-websocket-types

Types of cordova-plugin-advanced-websocket for Typescript/Ionic/Angular

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cordova-plugin-advanced-websocket-types

Typescript additional types package for the cordova plugin cordova-plugin-advanced-websocket

Installation

ionic cordova plugin add cordova-plugin-advanced-websocket
npm i --save-dev cordova-plugin-advanced-websocket-types

Typescript / Ionic Example

import {
  CordovaWebsocketOptions,
  CordovaWebsocketPlugin
} from 'cordova-plugin-advanced-websocket-types';

const wsOptions: CordovaWebsocketOptions = {
  url: 'wss://echo.websocket.org',
  timeout: 5000,
  pingInterval: 10000,
  headers: {Authorization: `Bearer ${accessToken}`},
  acceptAllCerts: false
};

CordovaWebsocketPlugin.wsConnect(
  wsOptions, 
  event => { // CordovaWebsocketEvent
    console.log(`Received callback from WebSocket: ${event?.callbackMethod}`);
  }, 
  success => { // CordovaWebsocketSuccess
    console.log(`Connected to WebSocket with id: ${success.webSocketId}`);
  },
  error => { // CordovaWebsocketError
    console.log(`Failed to connect to WebSocket: code: ${error?.code}, reason: ${error?.reason}`, error?.exception);
  }
);

Keywords

FAQs

Package last updated on 26 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc