Help on Emitter for Generating Channel Key

I need to generate a channel key from the backend using emitter.

// Create the client and connect to the broker
    c, _ := emitter.Connect(host, func(_ *emitter.Client, msg emitter.Message) {
        fmt.Printf("[emitter] -> [B] received: '%s' topic: '%s'\n", msg.Payload(), msg.Topic())

    key2, err := c.GenerateKey(masterKey,newChannel, "rwls", ttl)
    if err != nil {


I am not getting any errors, but also not receiving any messages. Any idea what’s wrong here?

emitter.Connect returns an error as its second parameter but your sample is ignoring that value. Check to see if it’s non-nil.

1 Like

there was an issue in the emitter-io library, which is fixed now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.