Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jainpawan21
Copy link
Member

@jainpawan21 jainpawan21 commented Jun 17, 2025

  • added new API documentation for managing environments and workflows endpoints.
  • updated meta.json to include new apis
  • updated novu package versions

Summary by CodeRabbit

  • New Features

    • Added comprehensive API documentation for managing environments and workflows, including endpoints to create, update, delete, list, and retrieve details.
    • Introduced new schema documentation for Environment and Workflow entities.
    • Extended SDK documentation for JavaScript and React with new properties and customization options, such as preference groups and icon overrides.
  • Improvements

    • Updated type definitions to allow certain fields (e.g., subscriber details) to be nullable, enhancing flexibility.
    • Enhanced notification filtering in the JavaScript SDK with a new data filter attribute.
    • Improved React SDK appearance customization with additional style keys and props.
  • Chores

    • Upgraded Novu package dependencies to their latest versions.
    • Reorganized API documentation sections for better navigation.

@netlify
Copy link

netlify bot commented Jun 17, 2025

Deploy Preview for docs-novu ready!

Name Link
🔨 Latest commit 71ea737
🔍 Latest deploy log https://app.netlify.com/projects/docs-novu/deploys/6851a682b7eff6000807dace
😎 Deploy Preview https://deploy-preview-881--docs-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 17, 2025

Walkthrough

This update introduces comprehensive API documentation for the "Environments" and "Workflows" features, including new endpoint references and schema definitions. It also updates type definitions for subscribers and SDKs, enhancing type flexibility and customization. Dependency versions for several Novu packages are incremented, and the API documentation index is reorganized to include the new sections.

Changes

File(s) Change Summary
content/docs/api-reference/api-types.ts Added Environment type alias, reorganized exports, and moved Workflow export to the end.
content/docs/api-reference/environments/*.mdx Added documentation for environment endpoints: create, delete, update, list, and schema.
content/docs/api-reference/workflows/*.mdx Added documentation for workflow endpoints: create, delete, update, list, retrieve, sync, retrieve step, and schema.
content/docs/api-reference/meta.json Reordered documentation sections and added new "Workflows" and "Environments" API groups.
content/docs/api-reference/subscribers/subscriber-schema.mdx
content/docs/api-reference/topics/topic-schema.mdx
Updated Subscriber type to make several fields nullable (`string
content/docs/api-reference/events/broadcast-event-to-all.mdx Added blank lines; no functional or structural changes.
content/docs/platform/sdks/javascript/index.mdx Made applicationIdentifier in NovuOptions optional, and added data property to NotificationFilter. Updated usage examples.
content/docs/platform/sdks/react/index.mdx Updated InboxProps and appearance customization types: made applicationIdentifier optional, added preferenceGroups and icons props, and introduced new style keys for UI customization.
package.json Bumped versions for @novu/api, @novu/framework, @novu/js, and @novu/react dependencies.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant API
  participant Docs

  Client->>Docs: View API Reference
  Docs->>API: Reference endpoint schema (e.g., /v1/environments)
  Client->>API: Call endpoint (create, update, delete, list environment/workflow)
  API-->>Client: Return response (Environment/Workflow object)
Loading

Possibly related PRs

  • fix: api reference structure #851: Introduced the initial api-types.ts file with type aliases for API DTOs, which this PR extends by adding and reorganizing type exports for Environment and Workflow.

Suggested reviewers

  • Aviatorscode2

Poem

In burrows deep, I type and write,
New docs for workflows, shining bright.
Environments now have their say,
With types and schemas on display.
SDKs grow with fields anew—
A hoppy update, just for you!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jainpawan21 jainpawan21 self-assigned this Jun 17, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (12)
content/docs/platform/sdks/javascript/index.mdx (1)

21-24: Optional applicationIdentifier type update is correct.
Updating the type to string | undefined reflects the new optional behavior. Consider adding a minimal example that omits this field to illustrate its optionality in practice.

content/docs/platform/sdks/react/index.mdx (2)

17-20: Mark applicationIdentifier as optional.
The change to string | undefined is accurate. Consider updating the Inbox usage example to demonstrate initializing without this prop.


99-104: Include icons override example.
The icons property in InboxAppearanceProps enables icon customization. Adding a small code sample demonstrating icon overrides will improve discoverability.

content/docs/api-reference/events/broadcast-event-to-all.mdx (2)

14-21: Remove extra blank lines. This block contains unnecessary blank lines that can be trimmed to improve readability and maintain consistency with surrounding content.


28-35: Remove extra blank lines. These consecutive blank lines are redundant; removing them will tighten the layout.

content/docs/api-reference/environments/list-all-environments.mdx (2)

11-14: Normalize indentation in structuredData.contents.
The multi-line block has inconsistent leading spaces which may render extra indentation. Consider unifying the indent:

-      - content: |-
-          This API returns a list of environments for the current organization. 
-              Each environment contains its configuration, API keys (if user has access), and metadata.
+      - content: |-
+          This API returns a list of environments for the current organization. 
+          Each environment contains its configuration, API keys (if user has access), and metadata.

18-19: Page description duplicates structuredData.
Optional: you may streamline the markdown by consolidating or differentiating the in-body description from structuredData.

content/docs/api-reference/environments/delete-an-environment.mdx (1)

11-13: Align indentation in multi-line description

The content block uses uneven indentation, which may introduce unintended whitespace in the rendered doc. Consider this adjustment:

-      - content: |-
-          Delete an environment by its unique identifier **environmentId**. 
-              This action is irreversible and will remove the environment and all its associated data.
+      - content: |-
+          Delete an environment by its unique identifier **environmentId**.
+          This action is irreversible and will remove the environment and all its associated data.
content/docs/api-reference/environments/update-an-environment.mdx (1)

11-14: Align indentation in multi-line description

The description block has inconsistent indentation. Harmonize it as follows:

-      - content: |-
-          Update an environment by its unique identifier **environmentId**. 
-              You can modify the environment name, identifier, color, and other configuration settings.
+      - content: |-
+          Update an environment by its unique identifier **environmentId**.
+          You can modify the environment name, identifier, color, and other configuration settings.
content/docs/api-reference/workflows/workflow-schema.model.mdx (1)

7-7: Fix double punctuation
Remove the extra period after "debugging" to avoid a typographical error.
Suggested change:

- ... debugging.. Read more about workflows ...
+ ... debugging. Read more about workflows ...
content/docs/api-reference/workflows/workflow-schema.mdx (2)

7-7: Fix double punctuation
Remove the extra period after "debugging" to correct the typo.

- ... debugging.. Read more about workflows ...
+ ... debugging. Read more about workflows ...

9-94: Populate or omit empty field descriptions
All properties in the TypeTable have empty description fields, which undermines clarity. Please source descriptions from the API spec or remove the empty keys to streamline the documentation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec6379a and 71ea737.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • content/docs/api-reference/api-types.ts (2 hunks)
  • content/docs/api-reference/environments/create-an-environment.mdx (1 hunks)
  • content/docs/api-reference/environments/delete-an-environment.mdx (1 hunks)
  • content/docs/api-reference/environments/environment-schema.mdx (1 hunks)
  • content/docs/api-reference/environments/environment-schema.model.mdx (1 hunks)
  • content/docs/api-reference/environments/list-all-environments.mdx (1 hunks)
  • content/docs/api-reference/environments/update-an-environment.mdx (1 hunks)
  • content/docs/api-reference/events/broadcast-event-to-all.mdx (1 hunks)
  • content/docs/api-reference/meta.json (1 hunks)
  • content/docs/api-reference/subscribers/subscriber-schema.mdx (3 hunks)
  • content/docs/api-reference/topics/topic-schema.mdx (3 hunks)
  • content/docs/api-reference/workflows/create-a-workflow.mdx (1 hunks)
  • content/docs/api-reference/workflows/delete-a-workflow.mdx (1 hunks)
  • content/docs/api-reference/workflows/list-all-workflows.mdx (1 hunks)
  • content/docs/api-reference/workflows/retrieve-a-workflow.mdx (1 hunks)
  • content/docs/api-reference/workflows/retrieve-workflow-step.mdx (1 hunks)
  • content/docs/api-reference/workflows/sync-a-workflow.mdx (1 hunks)
  • content/docs/api-reference/workflows/update-a-workflow.mdx (1 hunks)
  • content/docs/api-reference/workflows/workflow-schema.mdx (1 hunks)
  • content/docs/api-reference/workflows/workflow-schema.model.mdx (1 hunks)
  • content/docs/platform/sdks/javascript/index.mdx (3 hunks)
  • content/docs/platform/sdks/react/index.mdx (7 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/docs/api-reference/workflows/workflow-schema.model.mdx

[typographical] ~7-~7: Two consecutive dots
Context: ...tivity Feed for monitoring and debugging.. Read more about workflows on [workflows...

(DOUBLE_PUNCTUATION)

content/docs/api-reference/workflows/workflow-schema.mdx

[typographical] ~7-~7: Two consecutive dots
Context: ...tivity Feed for monitoring and debugging.. Read more about workflows on [workflows...

(DOUBLE_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - docs-novu
  • GitHub Check: Header rules - docs-novu
  • GitHub Check: Pages changed - docs-novu
  • GitHub Check: Build and Lint
🔇 Additional comments (55)
package.json (1)

24-27: Dependency bumps look correct.
The versions for @novu/api, @novu/framework, @novu/js, and @novu/react align with the newly introduced environment and workflow APIs. Ensure the corresponding release notes have been reviewed for compatibility.

content/docs/platform/sdks/javascript/index.mdx (1)

111-118: New data filter property added correctly.
The addition of data: Record<string, unknown> to NotificationFilter allows arbitrary key-value filtering. Please double-check downstream type definitions and ensure examples handle this property as expected.

content/docs/platform/sdks/react/index.mdx (3)

405-410: Approve new element style key lockIcon.
The addition of lockIcon to InboxAppearanceElements provides fine-grained UI control and aligns with the broader style API.


743-750: Approve new workflow label style keys.
The workflowLabelHeaderContainer and workflowLabelIcon keys correctly extend the appearance API for workflows.


775-783: Approve preference group style keys.
The newly added preferencesGroup* keys offer granular styling for preference groups and integrate well with the updated API.

content/docs/api-reference/topics/topic-schema.mdx (9)

63-66: Allow firstName to be nullable. Updating the type to string | null ensures that the field can be explicitly null or omitted, aligning with the flexible subscriber model.


67-70: Allow lastName to be nullable. Changing the type to string | null reflects that the field may be absent or intentionally null.


71-74: Allow email to be nullable. Switching to string | null accommodates cases where email may not be provided.


75-78: Allow phone to be nullable. The string | null type handles scenarios without a phone number.


79-82: Allow avatar to be nullable. Using string | null covers subscribers without avatars.


83-86: Allow locale to be nullable. Changing to string | null supports unspecified locale preferences.


95-98: Allow isOnline to be nullable. Adjusting to boolean | null captures unknown or unset online status.


99-102: Allow lastOnlineAt to be nullable. Switching to string | null handles cases where last online timestamp is unavailable.


111-114: Allow timezone to be nullable. Using string | null supports subscribers without a defined timezone.

content/docs/api-reference/subscribers/subscriber-schema.mdx (9)

13-16: Allow firstName to be nullable. Changing to string | null ensures consistency with optional subscriber fields.


17-20: Allow lastName to be nullable. The update to string | null reflects real-world usage where last name may be omitted.


21-24: Allow email to be nullable. Adopting string | null aligns with flexible subscriber profiles.


25-28: Allow phone to be nullable. Switching to string | null accommodates subscribers without a phone.


29-32: Allow avatar to be nullable. The string | null type handles missing avatars.


33-36: Allow locale to be nullable. Changing to string | null supports unspecified locale settings.


45-48: Allow isOnline to be nullable. Adjusting to boolean | null captures undetermined online status.


49-52: Allow lastOnlineAt to be nullable. Switching to string | null covers cases where the timestamp is not set.


61-64: Allow timezone to be nullable. Using string | null handles subscribers without a timezone.

content/docs/api-reference/environments/environment-schema.model.mdx (1)

1-11: Document new Environment schema. The new file correctly introduces the Environment type and includes a type table reference to Environment in api-types.ts.

content/docs/api-reference/workflows/sync-a-workflow.mdx (1)

1-18: Add workflow synchronization endpoint documentation. The file accurately defines the PUT /v2/workflows/{workflowId}/sync operation with the appropriate metadata, auto-generation notice, and APIPage component.

content/docs/api-reference/workflows/create-a-workflow.mdx (4)

1-12: Frontmatter configuration is correct.
The YAML metadata correctly specifies the POST method and /v2/workflows route.


14-14: Auto-generated file notice is present.
The notice prevents manual edits and reminds maintainers to re-run the generation command.


16-17: Page title and description match the endpoint.
The human-readable title and summary clearly describe the “create workflow” operation.


18-18: Verify API specification link and operation details.
Ensure the document URL is current and that the OpenAPI spec defines a POST /v2/workflows operation.

#!/bin/bash
# Verify the OpenAPI spec contains the POST /v2/workflows operation
curl -s https://spec.speakeasy.com/novu/novu/json-development-with-code-samples | jq '.paths["/v2/workflows"].post'
content/docs/api-reference/workflows/retrieve-a-workflow.mdx (3)

1-14: Frontmatter and descriptive block are accurate.
The GET method, route /v2/workflows/{workflowId}, and description align with the retrieve operation.


16-18: Auto-generated notice and summary are present.
The file correctly warns against manual edits and repeats the summary.


20-20: Verify APIPage configuration.
Confirm the spec URL and the operations path {workflowId} placeholder mapping are correct.

#!/bin/bash
# Verify the OpenAPI spec contains the GET /v2/workflows/{workflowId} operation
curl -s https://spec.speakeasy.com/novu/novu/json-development-with-code-samples | jq '.paths["/v2/workflows/{workflowId}"].get'
content/docs/api-reference/meta.json (2)

47-61: Workflows group added to navigation index.
The new "---Workflows---" section and its entries for schema, CRUD, list, sync, and steps are correctly positioned.


62-68: Environments group added to navigation index.
The "---Environments---" section with schema, create, update, delete, and list entries is correctly inserted.

content/docs/api-reference/environments/list-all-environments.mdx (3)

1-10: Frontmatter configuration is correct.
The GET /v1/environments route and metadata accurately reflect the “list all environments” endpoint.


16-16: Auto-generated file notice is present.
The generation comment correctly warns against manual edits.


21-21: ```shell
#!/bin/bash

Show the GET operation under /v1/environments in the OpenAPI spec

curl -s https://spec.speakeasy.com/novu/novu/json-development-with-code-samples
| grep -n -A5 '/v1/environments:'


</details>
<details>
<summary>content/docs/api-reference/workflows/delete-a-workflow.mdx (4)</summary>

`1-11`: **Frontmatter configuration is correct.**
The DELETE method, route `/v2/workflows/{workflowId}`, and description match the delete operation.

---

`14-14`: **Auto-generated file notice is present.**
The generation comment prevents manual edits.

---

`16-17`: **Operation description matches metadata.**
The inline summary clearly states the removal of a workflow by its `workflowId`.

---

`18-18`: **Verify DELETE operation in spec.**
Confirm the OpenAPI document defines the DELETE `/v2/workflows/{workflowId}` operation:

```shell
#!/bin/bash
# Check for DELETE /v2/workflows/{workflowId} in the spec
curl -s https://spec.speakeasy.com/novu/novu/json-development-with-code-samples | jq '.paths["/v2/workflows/{workflowId}"].delete'
content/docs/api-reference/workflows/retrieve-workflow-step.mdx (2)

1-12: Frontmatter validation: GET endpoint configuration looks correct

The _openapi metadata correctly specifies the GET method and the route /v2/workflows/{workflowId}/steps/{stepId}, and toc/structuredData are properly initialized.


16-18: APIPage component configuration is accurate

The <APIPage> invocation correctly references the intended operation path and spec URL.

content/docs/api-reference/api-types.ts (2)

1-16: Import of EnvironmentResponseDto is correct

The new import from @novu/api/models/components adds EnvironmentResponseDto and is used below to define the Environment alias.


40-45: Exports for Environment and Workflow types are correctly organized

The file now cleanly groups the Environment and Workflow type aliases at the end, making the exports more domain-centric.

content/docs/api-reference/environments/delete-an-environment.mdx (2)

1-14: Frontmatter metadata for DELETE /v1/environments/{environmentId} is correct

The _openapi block properly defines the DELETE method and route, and the structured data sections are initialized without unintended values.


17-21: Duplicate description outside frontmatter is expected for auto-generated docs. The generator handles synchronization.

content/docs/api-reference/environments/update-an-environment.mdx (2)

1-14: Frontmatter metadata for PUT /v1/environments/{environmentId} is correct

The _openapi block is configured correctly for the update endpoint. All fields are properly set.


17-21: Duplicate description outside frontmatter is normal for the auto-generated pages.

content/docs/api-reference/workflows/update-a-workflow.mdx (2)

1-14: Frontmatter metadata for PUT /v2/workflows/{workflowId} is correct

The _openapi block correctly defines the PUT method and route. The metadata aligns with other workflow endpoints.


17-20: The content duplication outside frontmatter is expected in auto-generated docs.

content/docs/api-reference/environments/create-an-environment.mdx (1)

1-23: New endpoint documentation looks correct—approved
The frontmatter, descriptive copy, and <APIPage> component align with existing API references. The auto-generated notice guards against manual edits.

content/docs/api-reference/workflows/workflow-schema.model.mdx (1)

1-11: Workflow schema model is well-structured—approved
Frontmatter, heading, and the ---type-table--- reference to Workflow are correctly defined and consistent with other model files.

content/docs/api-reference/workflows/list-all-workflows.mdx (1)

1-18: List-all-workflows endpoint doc is properly structured
Frontmatter metadata, auto-generated notice, and <APIPage> integration match project conventions.

content/docs/api-reference/environments/environment-schema.mdx (1)

1-38: Environment schema type table is correctly defined—approved
All environment properties and descriptions align with the API spec and follow the TypeTable format.

Comment on lines 47 to +52
"type": "PreferencesFilter"
},
"preferenceGroups": {
"description": "",
"type": "PreferenceGroups"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Document the new preferenceGroups prop.
You’ve introduced a preferenceGroups prop in InboxProps. Please include a snippet in the usage section showing how to pass this prop and describe its purpose.

🤖 Prompt for AI Agents
In content/docs/platform/sdks/react/index.mdx around lines 47 to 52, the new
preferenceGroups prop in InboxProps is undocumented. Add a usage example snippet
demonstrating how to pass the preferenceGroups prop and include a clear
description of its purpose in the usage section to help users understand its
role and how to use it.

@jainpawan21 jainpawan21 merged commit 0fc6f63 into main Jun 17, 2025
7 checks passed
@jainpawan21 jainpawan21 deleted the feature/environment-and-workflow-apis branch June 17, 2025 18:39
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