Skip to content

feature: context#993

Merged
jainpawan21 merged 6 commits intomainfrom
feature/context
Oct 28, 2025
Merged

feature: context#993
jainpawan21 merged 6 commits intomainfrom
feature/context

Conversation

@jainpawan21
Copy link
Member

@jainpawan21 jainpawan21 commented Oct 26, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Contexts feature for organizing and personalizing notifications across workflows and subscribers
    • Context management API with create, retrieve, update, delete, and list operations
    • Context support in Inbox component for tenant-specific notification filtering
    • JavaScript and React SDK integration for context handling
  • Updates

    • Enhanced notification and message schemas with context field support
    • Updated provider credential behavior for improved device token management
    • Added context configuration options in Inbox and workflow documentation
  • Documentation

    • Comprehensive guides for managing contexts and integrating with workflows
    • New examples and use cases for multi-tenant and personalized notification scenarios

* Docs for content page and CRUD operations for context

* Docs for context

* change page description

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update based on feedback

* Update context based on Adam's feedback

* Add new update

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: DianaHackmamba <diana@hackmamba.io>

* Update content/docs/platform/workflow/contexts.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Content for the context page in the workflow section

* Docs for the inbox with context page

* Update the JS and React SDK guide

* Update content/docs/platform/workflow/contexts/index.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update content/docs/platform/inbox/configuration/inbox-with-context.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update content/docs/platform/workflow/contexts/manage-contexts.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fixed code errors

* Update docs for workflow trigger and Inbox to not upsert context but rather do findOrCreate,

* Add contexts image

* Update code block

* fix: PR suggestions and issues

---------

Co-authored-by: DianaHackmamba <diana@hackmamba.io>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Pawan Jain <jainpawan211199@gmail.com>
@netlify
Copy link

netlify bot commented Oct 26, 2025

Deploy Preview for docs-novu failed. Why did it fail? →

Name Link
🔨 Latest commit 757a14b
🔍 Latest deploy log https://app.netlify.com/projects/docs-novu/deploys/69010bd08daf8d00080e4639

@jainpawan21 jainpawan21 changed the title Docs for content page and CRUD operations for context (#983) feature: context Oct 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces comprehensive context functionality documentation across the Novu platform, adding context-specific API reference pages, workflow integration guides, and SDK documentation updates while also revising behavioral descriptions for credential handling and updating dependency versions.

Changes

Cohort / File(s) Summary
Context API Reference
content/docs/api-reference/contexts/*
Added six new API reference pages for context CRUD operations: create-a-context.mdx, retrieve-a-context.mdx, update-a-context.mdx, delete-a-context.mdx, list-all-contexts.mdx, and schema documentation pages context-schema.mdx and context-schema.model.mdx.
Workflow Context Documentation
content/docs/platform/workflow/contexts/*
New documentation structure: index.mdx introducing contexts, manage-contexts.mdx covering full CRUD operations via dashboard/API, contexts-in-workflows.mdx explaining template/condition usage, and meta.json for navigation.
SDK Documentation Updates
content/docs/platform/sdks/javascript/index.mdx, content/docs/platform/sdks/javascript/index.model.mdx, content/docs/platform/sdks/react/index.mdx, content/docs/platform/sdks/react/hooks/novu-provider.mdx
Expanded public APIs with context support: added context, contextHash, defaultSchedule properties to NovuOptions/InboxProps; new Schedule methods and types; added schedule-related ElementStyles keys for UI customization.
Inbox Configuration with Context
content/docs/platform/inbox/configuration/inbox-with-context.mdx, content/docs/platform/inbox/configuration/meta.json
New page documenting context scoping for Inbox filtering; updated meta.json to include inbox-with-context page in navigation.
API Schema Updates
content/docs/api-reference/messages/message-schema.mdx, content/docs/api-reference/notifications/notification-event-schema.mdx, content/docs/api-reference/integrations/integration-schema.mdx, content/docs/api-reference/subscribers/subscriber-schema.mdx
Added contextKeys field to Message type; updated Notification type fields (payload, controls, to now accept generic objects; added contextKeys); added appIOBaseUrl to Credentials schemas.
Behavioral Documentation Revisions
content/docs/api-reference/subscribers/update-provider-credentials.mdx, content/docs/api-reference/subscribers/upsert-provider-credentials.mdx
Clarified credential update semantics: update-provider-credentials now specifies create/replace behavior; upsert-provider-credentials now describes create/append instead of replace semantics.
Events & Notifications Documentation
content/docs/api-reference/events/broadcast-event-to-all.mdx, content/docs/api-reference/events/trigger-event.mdx, content/docs/api-reference/notifications/list-all-events.mdx
Minor whitespace cleanup in broadcast-event; duplicated paragraph and extra spacing in trigger-event; added severity and contextKeys filters to list-all-events documentation.
Translation API Documentation
content/docs/api-reference/translations/retrieve-a-translation-group.mdx
Updated description to reflect support for multiple resource types (workflow, layout) and IDs.
Activity Tracking Documentation
content/docs/api-reference/activity/track-activity-and-engagement-events.mdx
New API reference page for POST /v2/inbound-webhooks/delivery-providers endpoint.
Navigation & Meta Updates
content/docs/api-reference/meta.json, content/docs/platform/meta.json, content/docs/platform/sdks/types/js-types.ts
Updated meta.json files to include new context pages in navigation; exported Schedule type from js-types.ts.
Dependency Updates
package.json
Bumped @novu/api from ^1.6.0 to 1.8.0 (removed caret); @novu/js from ^3.10.1 to 3.11.0; @novu/react from 3.10.1 to 3.11.0.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as Workflow
    participant Context as Context Manager
    participant Notification as Notification Service
    participant Inbox as Inbox Component

    rect rgb(200, 220, 255)
    Note over Workflow,Inbox: Context Creation & Flow
    end

    Workflow->>Context: Create/Update Context (type, id, data)
    Context-->>Workflow: Context stored

    Workflow->>Notification: Trigger event with context key
    Notification->>Context: Resolve context by key
    Context-->>Notification: Return context data

    rect rgb(200, 255, 220)
    Note over Notification,Inbox: Context-Filtered Delivery
    end

    Notification->>Notification: Apply context in templates<br/>({{context.tenant}})
    Notification->>Inbox: Send notification with contextKeys
    Inbox->>Inbox: Filter messages by context scope
    Inbox-->>Notification: Filtered view rendered

    rect rgb(255, 240, 200)
    Note over Workflow,Inbox: Context Persistence
    end

    Note over Context: Context persists across<br/>multiple workflows & calls
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Schema consistency: Verify that contextKeys, appIOBaseUrl, and generic object types are consistently applied across Message, Notification, Integration, and Subscriber schemas.
  • SDK documentation accuracy: Confirm that new properties (context, contextHash, defaultSchedule) and Schedule methods/types are correctly reflected in both JavaScript and React documentation.
  • Navigation structure: Review meta.json updates to ensure new context pages are correctly ordered and linked in both API reference and workflow sections.
  • Behavioral description updates: Validate that credential handling changes (append vs. replace semantics) are consistently documented across update and upsert pages.
  • Duplicate content: Verify that the duplicated paragraph in trigger-event.mdx was intentional or if cleanup is needed.

Possibly related PRs

Suggested reviewers

  • Aviatorscode2
  • DianaHackmamba
  • ChmaraX

🐰 Context flows through your workflows,
Persistent and shared across the streams,
Tenants and themes in gentle pockets,
Making notifications personalized dreams.
✨ The docs now show the way!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/context

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4726295 and 757a14b.

⛔ Files ignored due to path filters (12)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • public/images/inbox/Contexts.png is excluded by !**/*.png
  • public/images/inbox/context-trigger.png is excluded by !**/*.png
  • public/images/inbox/context.png is excluded by !**/*.png
  • public/images/workflows/context-step-conditions.png is excluded by !**/*.png
  • public/images/workflows/contexts/context.gif is excluded by !**/*.gif
  • public/images/workflows/contexts/create-context.png is excluded by !**/*.png
  • public/images/workflows/contexts/create-contexts.png is excluded by !**/*.png
  • public/images/workflows/contexts/delete-context.png is excluded by !**/*.png
  • public/images/workflows/contexts/delete.png is excluded by !**/*.png
  • public/images/workflows/resolved-context.png is excluded by !**/*.png
  • public/images/workflows/search-context-activityfeed.png is excluded by !**/*.png
📒 Files selected for processing (32)
  • content/docs/api-reference/activity/track-activity-and-engagement-events.mdx (1 hunks)
  • content/docs/api-reference/contexts/context-schema.mdx (1 hunks)
  • content/docs/api-reference/contexts/context-schema.model.mdx (1 hunks)
  • content/docs/api-reference/contexts/create-a-context.mdx (1 hunks)
  • content/docs/api-reference/contexts/delete-a-context.mdx (1 hunks)
  • content/docs/api-reference/contexts/list-all-contexts.mdx (1 hunks)
  • content/docs/api-reference/contexts/retrieve-a-context.mdx (1 hunks)
  • content/docs/api-reference/contexts/update-a-context.mdx (1 hunks)
  • content/docs/api-reference/events/broadcast-event-to-all.mdx (0 hunks)
  • content/docs/api-reference/events/trigger-event.mdx (1 hunks)
  • content/docs/api-reference/integrations/integration-schema.mdx (1 hunks)
  • content/docs/api-reference/messages/message-schema.mdx (1 hunks)
  • content/docs/api-reference/meta.json (1 hunks)
  • content/docs/api-reference/notifications/list-all-events.mdx (1 hunks)
  • content/docs/api-reference/notifications/notification-event-schema.mdx (2 hunks)
  • content/docs/api-reference/subscribers/subscriber-schema.mdx (1 hunks)
  • content/docs/api-reference/subscribers/update-provider-credentials.mdx (1 hunks)
  • content/docs/api-reference/subscribers/upsert-provider-credentials.mdx (1 hunks)
  • content/docs/api-reference/translations/retrieve-a-translation-group.mdx (1 hunks)
  • content/docs/platform/inbox/configuration/inbox-with-context.mdx (1 hunks)
  • content/docs/platform/inbox/configuration/meta.json (1 hunks)
  • content/docs/platform/meta.json (1 hunks)
  • content/docs/platform/sdks/javascript/index.mdx (9 hunks)
  • content/docs/platform/sdks/javascript/index.model.mdx (5 hunks)
  • content/docs/platform/sdks/react/hooks/novu-provider.mdx (4 hunks)
  • content/docs/platform/sdks/react/index.mdx (4 hunks)
  • content/docs/platform/sdks/types/js-types.ts (2 hunks)
  • content/docs/platform/workflow/contexts/contexts-in-workflows.mdx (1 hunks)
  • content/docs/platform/workflow/contexts/index.mdx (1 hunks)
  • content/docs/platform/workflow/contexts/manage-contexts.mdx (1 hunks)
  • content/docs/platform/workflow/contexts/meta.json (1 hunks)
  • package.json (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jainpawan21 jainpawan21 marked this pull request as ready for review October 28, 2025 18:30
@jainpawan21 jainpawan21 merged commit 3de9406 into main Oct 28, 2025
1 of 5 checks passed
@jainpawan21 jainpawan21 deleted the feature/context branch October 28, 2025 18:31
@coderabbitai coderabbitai bot mentioned this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants