TheShipStack Docs
Features

Notifications

In-app notifications generated on real app events.

TheShipStack includes an in-app notification system that generates notifications on meaningful events across the app.

What triggers notifications

EventRecipients
Workspace renamedAll members
Project createdAll members
Project deletedAll members
Member role changedAffected member
Member removedAffected member
Subscription activatedWorkspace owner
Plan changedWorkspace owner
Cancellation scheduledWorkspace owner
Payment failedWorkspace owner

Sending notifications

Three helpers in lib/notify.ts cover the common fan-out patterns:

import { notifyUser, notifyOrgMembers, notifyOrgOwners } from '@/lib/notify'

// Notify a specific user
await notifyUser(userId, {
  title: 'Your role has been updated',
  body: 'You are now an admin in this workspace.',
  href: '/dashboard/workspace/settings',
})

// Notify all members of a workspace
await notifyOrgMembers(orgId, {
  title: 'Project deleted',
  body: `"My Project" was deleted.`,
  href: '/dashboard',
})

// Notify only the workspace owner (e.g. billing events)
await notifyOrgOwners(orgId, {
  title: 'Payment failed',
  body: 'Your latest invoice could not be charged. Update your payment method.',
  href: '/dashboard/workspace/settings?tab=billing',
})

Notification payload

FieldTypeDescription
titlestringShort title shown in the notification list
bodystringFull description
hrefstring (optional)Link the notification navigates to when clicked

Adding notifications to your own actions

Call the appropriate helper at the end of your server action, after the main operation succeeds:

export async function publishPost(postId: string) {
  const { orgId } = await requireOrg()
  // ... your logic ...
  await notifyOrgMembers(orgId, {
    title: 'New post published',
    body: `A new post is live.`,
    href: `/dashboard/posts/${postId}`,
  })
}

On this page