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

@heroiclabs/nakama-js-protobuf

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heroiclabs/nakama-js-protobuf

Websocket adapter adding protocol buffer support to the Nakama Javascript client.

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

Nakama JavaScript Protobuf adapter

Websocket adapter adding protocol buffer support to the nakama-js client.

Nakama is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much more.

Getting Started

  1. Import the adapter into your project:

    yarn add "@heroiclabs/nakama-js-protobuf"
    
  2. Pass the Protobuf adapter to build the socket object.

    import {Client} from "@heroiclabs/nakama-js";
    import {WebSocketAdapterPb} from "@heroiclabs/nakama-js-protobuf"
    
    const useSSL = false; // Enable if server is run with an SSL certificate.
    const client = new Client("defaultkey", "127.0.0.1", 7350, useSSL);
    
    const trace = false;
    const socket = client.createSocket(useSSL, trace, new WebSocketAdapterPb());
    
  3. Use the WebSocket:

    socket.ondisconnect = (evt) => {
        console.info("Disconnected", evt);
    };
    
    const session = await socket.connect(session);
    // Socket is open.
    

License

This project is licensed under the Apache-2 License.

Keywords

FAQs

Package last updated on 26 Sep 2023

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