Skip to content

Provide an example for plain browser usage #23

@bluepuma77

Description

@bluepuma77

Can you describe the steps required to use ddp.js in a browser via HTML file?

(Happy to use older versions 0.6.0 or 1.1.0)

<html>
  <head>
    <script src="???"></script>
    <script>

      const options = {
          endpoint: "ws://localhost:3000/websocket",
          SocketConstructor: WebSocket
      };
      const ddp = new DDP(options);

      ddp.on("connected", () => {
          console.log("Connected");
      });

    </script>
  </head>
  <body>
    <p>Check the console log for DDP messages</p>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions