contextio-nextdeprecated

Generated GRPC/Protobutt test client

Usage no npm install needed!

<script type="module">
  import contextioNext from 'https://cdn.skypack.dev/contextio-next';
</script>

README

Context.IO Next

Generated GRPC/Protobutt test client

Structure

  • index.js is a wrapping layer for better UX/DX, also handles connecting to the server for you
  • ca.pem is the CA public cert used to generate client certs/keys
  • /lib/cat_pb.js and /lib/cat_grpc_pb.js are generated from cat.proto

Usage

  1. Import the package

    const CIO = require('contextio-next')
    
  2. Connect to the server with your ssl cert and key. You can generate/download these from our futuristic developer console. DO NOT check these into source control or make them publicly accessible!

    const client = CIO.CreateClient(cert, key)
    
  3. Create your request from the objects in Types

    const req = new CIO.Types.NewCatRequest()
    req.setName(name)
    req.setColor(color)
    
  4. Make a call!

    client.newCat(req, (err, res) => {
      if (err) {
        return console.error(err)
      }
    
      console.log(res)
    })