Documentation Release Notes - December 2024

December might be a quiet time for some, but not here! We’ve been busy rolling out some exciting updates and refining our documentation UX.

Here's what's new:

  • We’ve added support for custom message types across various SDKs, making it easier to work with our Publish, Subscribe, Message Persistence, and Files APIs.

  • There’s also a new membership type feature designed to help you classify user-channel relationships more easily.

  • For all the Unity developers out there, we’ve introduced support for WebGL, making sure your projects can seamlessly transition to the web.

  • The JavaScript Chat SDK has seen improvements too, with simplified message draft handling, making it easier to keep track of your conversations.

  • Our Functions offering has undergone a major transformation with the introduction of v2, bringing in versioning and several useful new modules.

  • Over in the Illuminate Dashboards, we've made it simpler to manage charts, ensuring a smoother experience all round.

  • On the documentation front, we’ve added quick links and a context switcher in the SDK docs to make it easy to navigate.

We hope these updates provide you with the necessary tools and guidance at your fingertips as you continue to build amazing things!

SDKs 📦

Custom message type (follow-up)

Type: New feature

Following the updates from last month, we have now added support for the message type parameter in Publish, Subscribe, Message Persistence, and Files APIs in the following SDKs:

//Publishing Dictionary
Dictionary<string, float> position = new Dictionary<string, float>();
position.Add("lat", 32F);
position.Add("lng", 32F);

Console.WriteLine("before pub: " + pubnub.JsonPluggableLibrary.SerializeToJsonString(position));

PNResult<PNPublishResult> publishResponse = await pubnub.Publish()
.Message(position)
.Channel("my_channel")
.CustomMessageType("text-message")
.ExecuteAsync();
PNPublishResult publishResult = publishResponse.Result;
PNStatus status = publishResponse.Status;
Console.WriteLine("pub timetoken: " + publishResult.Timetoken.ToString());
show all 16 lines

Read Message Types for an overview of the new parameter and information on how it differs from the internal PubNub message type.

Membership type

Type: New feature

We've introduced yet another field to help you categorize memberships more easily. The membership type field lets you define a type of relationship between a user and a channel they are a member of.

For now, the following SDKs support the new field:

List<PNMembership> setMembershipChannelMetadataIdList = new List<PNMembership>();
setMembershipChannelMetadataIdList.Add(new PNMembership()
{
Channel = "my-channel",
Custom = new Dictionary<string, object>() { { "item", "book" } },
Type = "admin" // Assigning the type as "admin"
});

PNResult<PNMembershipsResult> setMembershipsResponse = await pubnub.SetMemberships()
.Uuid("my-uuid")
.Channels(setMembershipChannelMetadataIdList)
.Include(new PNMembershipField[] { PNMembershipField.CUSTOM, PNMembershipField.CHANNEL, PNMembershipField.CHANNEL_CUSTOM })
.IncludeCount(true)
.ExecuteAsync();

show all 17 lines

WebGL in Unity SDK

Type: New feature

You can now configure your Unity project to support WebGL builds using the PubNub Unity SDK. Configuring WebGL for PubNub Unity SDK is essential because it ensures that applications using PubNub's real-time communication services can operate effectively within a web environment.

For detailed configuration steps, head to the Unity SDK docs.

Message drafts (v2) in JS Chat SDK

Type: New feature

Last month, we added support for message drafts in mobile Chat SDKs.

This month, we extended this feature to the JavaScript Chat SDK. However, this SDK had already supported the message draft feature with an implementation we decided to simplify. To align the JavaScript Chat SDK with other Chat SDKs, we decided to add support for message drafts in v2 while still supporting the previous logic as v1.

If you use the JavaScript Chat SDK and the message draft feature and would like to migrate your code or get more details, head to the docs or contact support.

Handling moderation events

Type: Improvement

We addressed feedback received on Chat SDK moderation events and decided to document how you can catch any muting/banning event types using Events & Actions.

The docs for JavaScript and Kotlin Chat SDKs have been updated to explain the whole flow, starting from the moment an event is generated to the point when it's listened to and actioned upon.

To facilitate the flow, we slightly updated the channel path to which all moderation events are sent by adding the PUBNUB_INTERNAL_MODERATION. prefix to all [user_id] channels (like, PUBNUB_INTERNAL_MODERATION.alex), letting you filter out all such channels with Events & Actions listeners.

Functions ⚙️

Functions v2

Type: New feature

One of the significant changes we introduced this month was a complete refresh of our Functions offering.

Functions v2

All new customers who start using Functions will get this revamped experience in v2:

  • Functions finally support versioning
  • Functions now operate on an account instead of a keyset level, giving you one Package of Functions deployed to multiple keysets (no need to copy and paste Functions anymore as many times as they have to be deployed)
  • Zero-downtime deployment – thanks to rolling updates, you don't have to stop your Function first to update and restart it as Functions get updated without any interruptions.
  • Public KV Store and Management APIs
  • Three new Modules (UUID, JSON Web Token, JSONPath Plus)

Those already using PubNub Functions (v1) will be gradually migrated to v2.

To read about all the differences between Functions v1 and v2, refer to the docs.

Illuminate 💡

Creating charts

Type: Improvement

Illuminate Dashboards UI has been updated to make it clear that:

  • You can now add or remove decision charts from each metric's chart on a Dashboard. Each metric's chart can have up to five Decision charts.

Manage decision charts

  • You cannot edit a metric that's already used in a Decision and added to a chart.

Chart preview

Check out the docs for details.

Other 🌟

Type: Enhancement

Apart from the product enhancements, we also introduced minor updates to the docs to facilitate your navigation experience.

To make it easier for you to browse the SDK docs, we added quick links to all Core and Chat SDKs.

Thanks to these links, you can quickly go back to the overviews for each SDK category.

Core SDKs

Context switcher in Chat SDK

Type: Enhancement

In addition to the quick links mentioned, we also added a context switcher to the Chat SDK docs, which lets you easily switch from one Chat SDK documentation set to another.

Context switcher

Last updated on