ย 

Changelog

The latest releases and improvements to Knock.

Test your fetch functions in realtime from the template editor

A couple weeks ago, we launched the fetch function for Knock workflows. Today, we're making it a lot easier to develop this function step with a realtime test runner purpose-built for fetch functions.

When you load the template editor, you should now see the new "Test console" in the lower half of the screen along with a "Send test" button next to the URL field. When you run a fetch function test, Knock will execute your fetch step in isolation, ignoring any steps before or after in your workflow. When the step has finished, Knock will load the result into the test console for your review in realtime with no need for a refresh!

We're always working to provide a great developer experience for everyone building with the Knock platform. With this new test runner, the develop โ†” debug cycle for fetch functions just got a great boost.

Check out the guide on testing fetch functions for more details, or head to the template editor now to try it out.

Set shared preference sets for all users and objects in an environment

We built preference sets in Knock to allow you to configure granular channel and workflow preferences on a per-user and per-object basis. Preference sets serve as a flexible tool to manage things like user-owned credentials and opt-in configurations.

But sometimes you may find you want to set preferences shared across all users and objects in your account. Today we're making that much easier with default preference sets!

You can now navigate to the new "Developers > Defaults" page, where you can configure a preference set that will be global to an entire Knock environment. When Knock loads the preferences for a recipient, it will merge the recipient's owned preferences into the global defaults. User and object preferences will still take precedence, but now you can manage shared preferences in a single space.

Fixes and improvements

  • ๐Ÿ› We fixed a bug that would prevent users in a small set of cases from saving a channel or fetch function template without a page reload.
  • ๐Ÿ› We fixed an issue where category preferences required all categories on a workflow to be opted-out before we considered the preference as opted-out.
  • ๐Ÿ› We fixed an issue where setting conditions for channel-type preferences would result in a 422 Unprocessable Entity error from the Knock API.

Audit logs

We've designed our service with security best practices in mind from day one. Audit logs form an important part of the security and compliance program within an organization, making it easy to proactively monitor for suspicious activity and retroactively understand the impact of a malicious actor. For this reason, we've always captured detailed logs of the actions happening across your account. Today we're pleased to announce that we're shipping support for viewing these audit logs from within the Knock dashboard.

With this initial release you'll see information about all of the actions occurring within Knock with detail about the team member who performed the action and additional context about which resource has been modified. You can even filter to an individual team member or a specific type of action if you need to get more granular.

Audit logs are available now across all plans and have the same retention period as other logs on your account. You'll find your audit logs under the "Settings" page.

Fixes and improvements

  • ๐Ÿ‘€ We separated out the "API Keys" and "Variables" section from under the "Developers" page to make them easier to find in the dashboard
  • ๐ŸŒฑ You can now select a preference set to view under a user or object, making it much easier to work with multiple preference sets

Fetch additional data as a workflow step

Today we're shipping a new function step to the Knock workflow builder: the fetch function. With the fetch function, you can build and execute HTTP requests to any external service as a step in your workflows. Knock will merge any data returned to a fetch step request into the global state for the workflow run, thus making it accessible to all templates in subsequent workflow steps!

You can use fetch functions to grab data for a workflow run that may not be readily available at the time you trigger a workflow, such as for workflows that use batching to create large activity groups. You can even use fetch functions to trigger side effects in your external systems as Knock processes a workflow run.

Our goal is to ensure Knock serves as many possible notification use-cases with a dead-simple interface. The fetch function adds even more flexibility to Knock and unlocks some neat ways to compose workflows.

Check out the new guide on fetch functions or head to the workflow editor now to get started with fetch functions in your workflows.

Trigger conditions for all

Trigger conditions, previously only available for channel steps, are now available for use in all workflow steps. As part of this expansion, we've also added a brand new guide on trigger conditions to the Knock docs.

Trigger conditions allow you to specify if a given step will execute at workflow execution time. They are one of the many ways you can build powerful logical notification flows with Knock.

With this update trigger conditions are now even more powerful and easier to use.

Performance tuning for our API logs

We've seen recently that it could take a long time (several seconds for our largest customers) to load the list of API logs in Knock. So we invested some time to dig in and address the issue. We found that both the structure of the query used to load the logs and the primary database index used to filter the query had a number of optimization opportunities.

After implementing the necessary changes, we've observed a substantial decrease in query time. For our largest customers, we've seen average query execution times decrease from from 12 seconds to 15 milliseconds!

Our API logs are an important part of the developer experience within Knock, and with this release we're ensuring that they feel performant at any scale.

Fixes and improvements

  • ๐ŸŒฑ We've added a UI for channel preferences to the user and object preferences tabs, including the ability to toggle a channel on/off from the Knock admin.

Give your customers control of notification branding

You can already use Knock to create branded notifications that put your brandโ€™s best foot forward when youโ€™re communicating with your customers. Now, with todayโ€™s per-tenant branding launch, you can extend that same functionality to your own customers.

With per-tenant branding you can set per-tenant overrides for any of the brand elements you already use in your Knock notifications, such as logo, icon, and brand color.

Hereโ€™s what this unlocks. If you have an enterprise customer that wants emails from your product to fit their branding (for example in the case they use your product to collaborate with their own customers or vendors), you can now do so with Knock. If custom branding hasnโ€™t been set for a tenant in your application, we fall back to the default branding you set in account settings.

If you're interested in enabling this feature for your account, you can check out the docs and connect with us at support@knock.app.

Fixes and improvements

  • ๐Ÿ‘€ We added support for connecting to AWS SES with an external ID instead of an access key and secret โ€“ please get in touch if you'd like this feature enabled on your account!

Java SDK โ˜•๏ธ

We've brewed up a fresh SDK for you and have added Java to our list of officially supported SDKs, making it easy to use Knock in your Java projects (including Spring Boot).

You can get started with the Java SDK by checking out the repo on Github, or adding the following to your build.gradle file:

dependencies {
  implementation 'app.knock.api:knock-client:0.2.0'
}

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

Fixes and improvements

  • ๐Ÿ‘€ We added a new set of integration pages to our marketing site to showcase all of the providers that Knock connects to
  • ๐Ÿ› We fixed an issue that was causing our test runner to fail to execute test runs
  • ๐Ÿ› Setting a very long recipient identifier no longer causes a batch step to fail in a workflow execution
  • ๐Ÿ› Email steps that have missing layouts no longer cause previews to return a 500 error

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