doman412 doman412 - 2 months ago 8x
Javascript Question

Wildcard subscribe not working as expected

Using the JS SDK v3.7.14, and simply placing the example code at this doc (which by the way has a typo in the error callback, no

variable declared) into my app for testing. Then, publishing to
, no message is received by the subscribed callback.

I have Data Stream Controller enabled as well as the Access Manager. I'm not getting any errors or 403's from any error callbacks, so I am to assume its not a PAM issue.

I grant the the user R/W access to
and the 'subscribe' connects fine, and the 'publish' callback returns a 'sent' obj, the message published to a sub-channel is not received however.


Enabling Wildcard Subscribe in the PubNub Stream Controller Add-On

You can enable Wildcard Subscribe by going into your PubNub Dashboard account:

  1. Select the appropriate App & Key
  2. Scroll down to the Stream Controller add-on
  3. If not already enabled, click the Add button
  4. Click the Configure button
  5. Click the Enable Wildcard Subscribe checkbox

Some quick highlights

  • Once wildcard subscribe is enabled, the asterisk (*) becomes a special/reserved character.
  • You must use the dot (.) to delimit each level
  • You can have up to 3 levels: a.b.c
  • You can only use the wildcard (*) at the end: a.b.*, not a.*.c

You have already visited our JS wildcard subscribe docs, but for anyone new to this, visit our developers page and choose the SDK (over 70 SDKs) you are using for more details.

See Wildcard Subscribe in the PubNub Knowledge Base for more details.

Please confirm that this has resolved your questions.