--- title: Notifications description: In-app notifications for your users. product: Notifications type: reference summary: How in-app notifications are configured for users. --- # Notifications kreogen offers a notifications package that allows you to send in-app notifications to your users. By default, it uses [Knock](https://knock.app/), a cross-channel notification platform that supports in-app, email, SMS, push, and chat notifications. Knock allows you to centralize your notification logic and templates in one place and [orchestrate complex workflows](https://docs.knock.app/designing-workflows/overview) with things like branching, batching, throttling, delays, and conditional sending. ## Setup To use the notifications package, you need to add the required environment variables to your project, as specified in the `packages/notifications/keys.ts` file. ## In-app notifications feed To render an in-app notifications feed, import the `NotificationsTrigger` component from the `@kreogen/notifications` package and use it in your app. We've already added this to the sidebar in the example app: ```tsx title="apps/app/app/(authenticated)/components/sidebar.tsx" import { NotificationsTrigger } from '@kreogen/notifications/components/trigger'; ``` Pressing the button will open the in-app notifications feed, which displays all of the notifications for the current user. ## Send a notification Knock sends notifications using workflows. To send an in-app notification, create a new [workflow](https://docs.knock.app/concepts/workflows) in the Knock dashboard that uses the [`in-app` channel provider](https://docs.knock.app/integrations/in-app/knock) and create a corresponding message template. Then you can [trigger that workflow](https://docs.knock.app/send-notifications/triggering-workflows) for a particular user in your app, passing in the necessary data to populate the message template: ```tsx title="notify.ts" import { notifications } from '@kreogen/notifications'; await notifications.workflows.trigger('workflow-key', { recipients: [{ id: 'user-id', email: 'user-email', }], data: { message: 'Hello, world!', }, }); ``` ## Multi-channel notifications Using Knock, you can add additional channel providers to your workflow to send notifications via email, SMS, push, or chat. To do this, create a new [channel provider](https://docs.knock.app/integrations) in the Knock dashboard, follow any configuration instructions for that provider, and add it to your workflow as a channel step. --- For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md) For an index of all available documentation, see [/llms.txt](/llms.txt)