pubnub-demo-integration
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Please be aware that this application / sample is provided as-is for demonstration purposes without any guarantee of support

PubNub-Demo-Integration

This is an internal PubNub tool.

NPM module designed to be used in JavaScript and TypeScript applications to facilitate communication between a demo app and the PubNub guided demo framework.

Installation

npm i pubnub-demo-integration

Interface

To send a message to the demo framework to indicate an action is completed:

Typescript:

actionCompleted(
  {
    action:'Action Name', 
    blockDuplicateCalls:true, // only applicable when called from the clientside
    debug:false
  });

Javascript:

actionCompleted(
{
  action: 'Action Name',
  debug: false,
  windowLocation: 'http://...',  // Optionally, pass in the URL of the current page so the identifier can be determined from the query string
  fetchClient: object // If run from the serverside, you can pass in an HTTP client for the module to use.  Clientside will use fetch()
});

You also need to define the action in the demo project's features.json file, at the root of the project:

{
    "features": [
      "Action Name"
    ]
}

Package Sidebar

Install

npm i pubnub-demo-integration

Weekly Downloads

16

Version

1.0.1

License

MIT

Unpacked Size

8.64 kB

Total Files

6

Last publish

Collaborators

  • pn-developer-relations