ย 

Changelog

The latest releases and improvements to Knock.

Identify users and objects within your notify calls

Today we're making it even easier to create and update your users and objects in Knock. You can now perform user and object identifications as an inline action within calls to the workflow trigger API.

When calling the trigger API, you can choose to include maps of properties describing users and objects to identify in Knock in the recipients and actor fields. While processing your workflow, we'll create or update each of these recipients accordingly.

curl --location --request POST 'https://api.knock.app/v1/workflows/my-workflow/trigger' \
  --header 'Authorization: Bearer sk_test_1234' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "key": "my-workflow",
    "recipients": [
      {"id": "user-1", "name": "User 1", "email": "user1@knock.app"}
    ]
  }'

Our goal is to make Knock as straight forward as possible for you to get started, and powerful enough to scale with your ever evolving needs. With inline identification, you can trigger your first Knock notification with a single API call, as well as explore new ways to manage your users in Knock.

See our guides on identification for users and for objects for more details.

Fixes and improvements

  • ๐ŸŒฑ In Knock analytics you can now group notification usage by enagement status

Go SDK

We've expanded our SDK coverage to support Go, making it effortless to start powering your notifications from your Go applications and services.

You can get started with the Go SDK by running go get github.com/knocklabs/knock-go or checking out the repo.

Want an SDK that we don't currently support? Let us know and we'll consider adding it.

Fixes and improvements

  • ๐ŸŒฑ You can now toggle the active status of a webhook to mark it as disabled and stop it sending
  • ๐Ÿ‘€ We added a new section in our documentation on going to production
  • ๐Ÿ› We fixed an issue where in-app notifications in the dashboard weren't getting marked as seen

Gain important insights into your notifications

Today weโ€™re launching Knock analytics. With Knock analytics, you get a single dashboard for understanding the notifications youโ€™re sending across all of your Knock channels, in all of your Knock environments.

With Knock analytics you can understand:

  • How your overall notification usage is trending over time.
  • How usage volume compares across your different channels and workflows, and whether there are opportunities to batch notifications to decrease the notification volume youโ€™re sending to your users.
  • How your delivery rates look for each of your notification channels so you can quickly identify configuration issues.

One of the core value props of Knock is that we act as a single layer to interact with all your delivery providers and their data. Knock analytics is a big part of that, giving you a single place to find valuable insights about the cross-channel notifications you send to your customers.

Fixes and improvements

  • ๐ŸŒฑ We expanded the integration guide in our documentation to cover every provider we support
  • ๐ŸŒฑ We created and open sourced a new in-app notifications example app: knock-in-app-notifications-react.vercel.app
  • ๐Ÿ‘€ We improved a loading state for API logs, now shown when applying filters or paginating
  • ๐Ÿ‘€ We improved the API error message when a nonexistent workflow is triggered
  • ๐Ÿ‘€ We improved the API error message when a JWT signing key is not yet generated for a non-development environment
  • ๐Ÿ‘€ We improved the API error message when attempting to set channel data on channels that do not support them
  • ๐Ÿ› We fixed the message details page to now correctly show its archived status
  • ๐Ÿ› [React Feed] We fixed an issue where Knock websocket connections were being terminated unexpectedly in React 18

Use outbound webhooks to respond in realtime to events within Knock

Today weโ€™re shipping support for webhooks in Knock so that you can more easily respond to the notification events happening and keep your system synchronized with the data in Knock. For more advanced use-cases of Knock, our customers need to keep track of the data that weโ€™re generating within their own system. Given the inherently asynchronous nature of sending notifications, there hasn't been a great way to do this today without polling data endpoints. Enter webhooks!

In your dashboard you'll now see a page where you can configure a webhook to listen to a number of events related to messages sent via your workflows. Once you set up an endpoint in your service to receive them, you can add the URL to the webhook creator and select which events you'd like to subscribe to. When your webhook starts sending requests you'll see delivery logs for those in the dashboard as well.

Some examples of how you can put webhooks to use in your system:

  • Store messages longer than our internal retention period
  • Populate a custom log of the messages sent to individual users in your system
  • Execute a side-effect in your application if a specific event occurs

With webhooks, you're in more control of your notification data than ever before.

Read the documentation to get started โ†’

Building in-app UI docs

When we first built the Knock Feeds API and React component library, we built them with feeds in mind. Since then we've seen customers use our notification infrastructure to build feeds, toasts, inboxes, preferences experiences, and much more! We've completely re-built our in-app UI documentation to showcase our in-app use cases and how to support them, whether you're building with React, Javascript, or React Native.

Check out the new documentation โ†’

PHP SDK

We've expanded our SDK coverage to support PHP. That means you're now easily able to integrate Knock into your Laravel applications with ease! You can get started with the PHP SDK by running composer require knocklabs/knock-php, or looking at our docs.

PHP SDK on Github โ†’

Fixes and improvements

  • ๐ŸŒฑ We now show items that have been removed from a batch in our debugger
  • ๐ŸŒฑ We made our new documentation search even more thorough as we now index all of our API reference too
  • ๐Ÿ‘€ Users can now be added from the dashboard in any environment, previously we restricted them from being created in production
  • ๐Ÿ‘€ We added the ability to filter workflows by a category and cleaned up the workflows list

Batch notifications dynamically with user, environment, or notify data

Building on our dynamic batch window work earlier this month, batch steps can now be configured with a dynamic batch window that draws from recipient, actor, notify, or environment variable data. A few use cases this unlocks:

  • Power per-user digests, where the digest frequency (i.e. daily, weekly) is set as a per-user preference
  • Use an environment variable to shorten batch windows in development and staging environments for easier testing
  • Set a batch window with data sent in your notify call, such as the priority or severity of an issue

Simply select "Batch for a dynamic window" followed by the batch window type (Recipient, Actor, or Data) and provide the batch window key for looking up the batch window value. This value can be either an ISO-8601 timestamp (e.g. 2022-05-05T20:00:00Z), or it can be a relative duration in the following format:

{
  "unit": "minutes", // Must be one of seconds, minutes, hours, days, weeks, or months
  "value": 10 // Any non-negative integer
}

With this release, our batch function just got even more powerful and we're excited to see what our customers use it to build.

Read the documentation to get started โ†’

Search the Knock docs

A popular request for our API documentation is finally here! Now you can search for items in our API docs to find what you need. Enjoy!

Fixes and improvements

  • ๐ŸŒฑ You can now clone workflow steps from within the workflow editor
  • ๐ŸŒฑ Workflow logs are now viewable on each workflow under a new โ€œLogsโ€ tab, filtered to show API logs for just that workflow
  • ๐ŸŒฑ We now support Mailjet as an email channel
  • ๐ŸŒฑ Read-only requests (e.g. loading user feeds) are a little faster thanks to under-the-hood improvements

Learn with our example app

Today we're announcing our first example app. We're a team that loves to learn by example when we're picking up new developer tools. The fastest way to understand how a tool works is to see it working in real code. Now you can learn by example when you're trying out Knock.

With the Knock example app you can see how a hypothetical collaboration product uses Knock to:

  1. Send welcome emails to new users after signup
  2. Trigger cross-channel notifications across email and in-app surfaces when actions happen in the app
  3. Power Slack integrations, including resource-to-channel notifications
  4. Customize user preferences per workflow and channel type
  5. Enable users to mute notifications for a particular resource
  6. Identify users and their preferences during initial setup with our bulk APIs

Our example app will continue to evolve as we ship new improvements, so stay tuned for more updates!

Check out the example app repo โ†’

Fixes and improvements

  • ๐Ÿ‘€ We now display better error messages when logs can't be retrieved
  • ๐Ÿ‘€ We now support liquid tags on email channels from name attribute
  • ๐Ÿ› We fixed an issue where email preview errors weren't being communicate well to dashboard users

Send silent push notifications with Knock

If you've used a smartphone, you know about push notifications. You may not be as familiar with silent push notifications.

Silent push notifications wake up your app in the background without interrupting your user. As Apple explains it, โ€œA [silent push notification is a notification that doesnโ€™t display an alert, play a sound, or badge your appโ€™s icon. It wakes your app in the background and gives it time to perform some actionsโ€.

An example: in a news reader app you might send silent push notifications when there's new content you want your app to download in the background. Once the new content has finished downloading, you could send a normal push to your user with the latest headline. When your user opens the app, the content is ready, making the experience snappy and polished.

Starting today, Knock supports silent push notifications on Apple, Firebase Cloud Messaging, and Expo Push. For our news reader example, what would have been a complicated set of backend logic becomes a single API call to a three step workflow whenever breaking news arrives:

  1. Send a silent push notification
  2. Delay (long enough for the device to load their content)
  3. Send a normal push notification

You can learn more about how to use silent push notifications in our docs.

Dynamic batch windows

Knock has always supported batching notifications over a set window of time. Now, batch steps can be configured to take a dynamic batch window that is set when you trigger your workflow.

A dynamic batch window will wait for an interval of time provided by you in the data of your notify call under a key you set when you create your workflow. The key you specify in the workflow editor can be dot-delimited (e.g. nested.path.to.window) to reach nested attributes. When this workflow step runs, Knock will use this value to set when your batch window will close.

This value can be either an ISO-8601 timestamp (e.g. 2022-05-05T20:00:00Z), or it can be a relative duration in the following format:

{
  "unit": "minutes", // Must be one of seconds, minutes, hours, days, weeks, or months
  "value": 10 // Any non-negative integer
}

Read the documentation to get started โ†’

Fixes and improvements

  • ๐ŸŒฑ The objects page on the dashboard now shows preferences (Previously object preferences were only managed via the API)
  • ๐ŸŒฑ Email channel settings can now use liquid tags and be dynamically populated
  • ๐ŸŒฑ We now support deleting user and object channel data via the API
  • ๐Ÿ‘€ We now lazy load message delivery logs and limit the list of logs to 25 at a time to keep the experience snappy
  • ๐Ÿ‘€ We improved email layout previews to look even more accurate to what is actually sent
  • ๐Ÿ› When viewing batched workflows in the debugger, we show more detail about batched workflows including their current status

Design beautiful notifications with our visual template editor

Today is a good day. Weโ€™re shipping our visual template editor to make it even easier to craft great-looking product notifications from within Knock.

Now you can use our drag-and-drop editor to build great looking email notifications that include text, buttons, quotes, and dividers, all without having to write a single line of 90s-era email HTML. (IYKYK.) This is a low code editor, not a no code editor. This means that we take away all the annoying parts of writing email templates, while still giving you the flexibility of markdown, HTML, and liquid syntax for variable injection and control flow. And of course if you want to write raw HTML and CSS on your own, you're always welcome to.

Weโ€™ve even added new branding settings so you can ensure your brand elements are consistent across all of your product messaging. ๐ŸŒ 

As of today, our visual template editor is only available for email templates. Weโ€™ll be expanding the visual template editor to other channel types with interactive components such as Slack later this year. For notification channels with text-only templatingโ€”SMS, push, in-appโ€”youโ€™ll be able to use the same code editor you already use in Knock. ๐Ÿ‘

Read the documentation to get started โ†’

Fixes and improvements

  • ๐Ÿ‘€ We added a better empty state display for Objects when none was found for a given collection
  • ๐Ÿ‘€ We improved the design of the variable pane in the message template editor
  • ๐Ÿ› We fixed an issue where message logs for email notifications with attachments were taking long to be retrieved in dashboard

More granular preference options with conditions

When working with preferences, youโ€™ll sometimes run into advanced use cases where you need to provide even more granular preference options for your customers. For example: you may want to let a user mute notifications about a given resource in your product. Thatโ€™s where preference conditions come into use in the Knock model: they provide a powerful way for you to add extra logic thatโ€™s computed during preference evaluation per recipient.

You can now apply a set of conditions to an individual category, workflow, or channel type preference, which will need to return true to send the notification out. The conditions you create can reference properties in your data payload or on the recipient. Here's an example of a condition where we only send a notification if the current resource is not in a list of muted ids for a recipient:

{
  "argument": "data.pageId",
  "operator": "not_contains",
  "variable": "recipient.mutedPageIds"
}

Read the documentation to get started โ†’

More accurate email previews

We know making sure you see an accurate preview for your notifications is crucial when creating your notifications. Previously, we had rendered a close approximation of your emails on the client, but there were some cases where what you would see in the preview tab would differ from what you'd see when you ran a test.

From today we now render the emails on the backend, applying the same set of transformations to the email as you get before it's delivered to your users. This means a much more accurate previewing experience, CSS warts and all #htmltables4eva.

Fixes and improvements

  • ๐Ÿ‘€ We now show you the variable pane on our workflow builder, with a new button in the top bar to toggle the variable pane on and off in both the builder and the message template editor
  • ๐Ÿ‘€ We moved the action menu in the email template editor into the top bar, cleaning up the UI
  • ๐Ÿ› We fixed an issue where our users.identify and objects.set endpoints weren't correctly upserting data
  • ๐Ÿ› We fixed an issue with attachments on AWS SES not coming through correctly
  • ๐Ÿ› We fixed an issue in our Elixir SDK where calling the Users.get_feed/3 endpoint with no options would cause an error

New messages API

Now you can bring the messages you send with Knock into your own product to power customer support and message logging use cases. Our new message API endpoints allow you to list all of the messages generated by Knock, as well as access additional message information such as batched activities, triggering events, and message content. Our messages API also supports a number of filtering options, so you can easily find the messages you're looking for.

Read the API documentation โ†’

Fixes and improvements

  • ๐Ÿ‘€ Our identify endpoint no longer requires a name or an email for a user
  • ๐Ÿ› We fixed a bug where nested variable paths weren't being properly parsed when a value existed for a top level path in the template editor
  • ๐Ÿ› We fixed an edge case in our push sender where sending any empty data payload on a notify call would cause an error