Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion content/docs/platform/inbox/configuration/data-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@

## Use data object keys as filters for tabs

You can use data object keys as filter for tabs. For more information, refer to [Tabs](/platform/inbox/configuration/tabs#filter-tabs-by-data-attributes).
Use data object keys to filter Inbox tabs, `useNotifications`, and bulk actions such as mark-all-read. Filters support exact scalars, OR lists, nested keys (one level), and AND-of-OR groups on the same field.

Check notice on line 67 in content/docs/platform/inbox/configuration/data-object.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/data-object.mdx#L67

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "content/docs/platform/inbox/configuration/data-object.mdx", "range": {"start": {"line": 67, "column": 157}}}, "severity": "INFO"}

Check notice on line 67 in content/docs/platform/inbox/configuration/data-object.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/data-object.mdx#L67

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/inbox/configuration/data-object.mdx", "range": {"start": {"line": 67, "column": 174}}}, "severity": "INFO"}

For examples and limits, refer to [Tabs — Using the data object](/platform/inbox/configuration/tabs#using-the-data-object).

Check failure on line 69 in content/docs/platform/inbox/configuration/data-object.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/data-object.mdx#L69

[Google.EmDash] Don't put a space before or after a dash.
Raw output
{"message": "[Google.EmDash] Don't put a space before or after a dash.", "location": {"path": "content/docs/platform/inbox/configuration/data-object.mdx", "range": {"start": {"line": 69, "column": 40}}}, "severity": "ERROR"}

```tsx
import { Inbox } from '@novu/react';
Expand Down
57 changes: 57 additions & 0 deletions content/docs/platform/inbox/configuration/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,63 @@
export default InboxTabs;
```

#### Match multiple values (OR)

Check warning on line 88 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L88

[Google.Headings] 'Match multiple values (OR)' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Match multiple values (OR)' should use sentence-style capitalization.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 88, "column": 6}}}, "severity": "WARNING"}

Check warning on line 88 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L88

[write-good.TooWordy] 'multiple' is too wordy.
Raw output
{"message": "[write-good.TooWordy] 'multiple' is too wordy.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 88, "column": 12}}}, "severity": "WARNING"}

Check notice on line 88 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L88

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 88, "column": 28}}}, "severity": "INFO"}

Match notifications when a data key equals any value in a list. Pass a scalar array or an explicit `{ or: [...] }` object:

```tsx
const tabs = [
{
label: 'Open or draft',
filter: {
data: { status: ['open', 'draft'] },
},
},
{
label: 'Team A or B',
filter: {
data: { team: { or: ['alpha', 'beta'] } },
},
},
];
```

#### Combine conditions (AND)

Check warning on line 109 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L109

[Google.Headings] 'Combine conditions (AND)' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Combine conditions (AND)' should use sentence-style capitalization.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 109, "column": 6}}}, "severity": "WARNING"}

Check notice on line 109 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L109

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 109, "column": 25}}}, "severity": "INFO"}

Check notice on line 109 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L109

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 109, "column": 26}}}, "severity": "INFO"}

Require multiple OR-groups on the same key by using `{ and: [{ or: [...] }, ...] }`. Every group must match. Use this when a notification stores an array in `data` and you need several values to appear together.

Check warning on line 111 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L111

[write-good.TooWordy] 'multiple' is too wordy.
Raw output
{"message": "[write-good.TooWordy] 'multiple' is too wordy.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 111, "column": 9}}}, "severity": "WARNING"}

Check warning on line 111 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L111

[write-good.Weasel] 'several' is a weasel word!
Raw output
{"message": "[write-good.Weasel] 'several' is a weasel word!", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 111, "column": 178}}}, "severity": "WARNING"}

```tsx
const tabs = [
{
label: 'Tagged urgent and in review',
filter: {
data: {
labels: { and: [{ or: ['urgent'] }, { or: ['review'] }] },
},
},
},
];
```

#### Nested data keys

Filter on one level of nesting under `data`. Sub-keys support the same scalar, array, `{ or }`, and `{ and }` shapes as top-level keys.

```tsx
const tabs = [
{
label: 'Project A or B',
filter: {
data: { project: { id: ['proj-a', 'proj-b'] } },
},
},
];
```

Multiple top-level keys in the same `data` filter are combined with AND logic. For example, `{ status: 'open', project: 'abc' }` matches only notifications where both keys match.

Check warning on line 141 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L141

[write-good.TooWordy] 'Multiple' is too wordy.
Raw output
{"message": "[write-good.TooWordy] 'Multiple' is too wordy.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 141, "column": 1}}}, "severity": "WARNING"}

Check warning on line 141 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L141

[write-good.Passive] 'are combined' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'are combined' may be passive voice. Use active voice if you can.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 141, "column": 51}}}, "severity": "WARNING"}

Check notice on line 141 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L141

[write-good.E-Prime] Try to avoid using 'are'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'are'.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 141, "column": 51}}}, "severity": "INFO"}

Check notice on line 141 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L141

[Google.Passive] In general, use active voice instead of passive voice ('are combined').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are combined').", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 141, "column": 51}}}, "severity": "INFO"}

Check notice on line 141 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L141

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 141, "column": 69}}}, "severity": "INFO"}

<Callout type="info">Data filter values must be scalars (string, number, boolean, or null). String values are limited to 256 characters. Each OR-group allows up to 100 values, with up to 30 AND-groups and 200 total values per field.</Callout>

Check notice on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[write-good.E-Prime] Try to avoid using 'be'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'be'.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 46}}}, "severity": "INFO"}

Check notice on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 57}}}, "severity": "INFO"}

Check notice on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[write-good.E-Prime] Try to avoid using 'are'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'are'.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 107}}}, "severity": "INFO"}

Check warning on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[write-good.Passive] 'are limited' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'are limited' may be passive voice. Use active voice if you can.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 107}}}, "severity": "WARNING"}

Check notice on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[Google.Passive] In general, use active voice instead of passive voice ('are limited').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are limited').", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 107}}}, "severity": "INFO"}

Check notice on line 143 in content/docs/platform/inbox/configuration/tabs.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/inbox/configuration/tabs.mdx#L143

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/inbox/configuration/tabs.mdx", "range": {"start": {"line": 143, "column": 191}}}, "severity": "INFO"}

### Using tags and data object

You can combine tags and the data object in the same filter to create more specific tabs tailored to your use case.
Expand Down
5 changes: 5 additions & 0 deletions content/docs/platform/sdks/javascript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ await novu.notifications.seenAll({
data: { type: 'login' }
});

// Match any of several data values (OR)
await novu.notifications.seenAll({
data: { status: ['open', 'draft'] },
});

// Mark all notifications as seen (no filters)
await novu.notifications.seenAll();
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": "string[]"
},
"data": {
"description": "",
"description": "Filter by notification.data keys. Each key accepts a scalar (exact match), a scalar array or { or: Scalar[] } (match any value), { and: [{ or: Scalar[] }, ...] } (AND of OR-groups), or a one-level nested object with the same shapes on sub-keys. Multiple keys are AND-ed.",

Check failure on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Quotes] Commas and periods go inside quotation marks.
Raw output
{"message": "[Google.Quotes] Commas and periods go inside quotation marks.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 20}}}, "severity": "ERROR"}

Check warning on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Novu.SentenceLength] Sentences should not exceed 25 words; this one has 33.
Raw output
{"message": "[Novu.SentenceLength] Sentences should not exceed 25 words; this one has 33.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 55}}}, "severity": "WARNING"}

Check notice on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 81}}}, "severity": "INFO"}

Check warning on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Colons] ': S' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': S' should be in lowercase.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 118}}}, "severity": "WARNING"}

Check warning on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Colons] ': S' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': S' should be in lowercase.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 162}}}, "severity": "WARNING"}

Check warning on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Ellipses] In general, don't use an ellipsis.
Raw output
{"message": "[Google.Ellipses] In general, don't use an ellipsis.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 176}}}, "severity": "WARNING"}

Check notice on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 184}}}, "severity": "INFO"}

Check warning on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[write-good.TooWordy] 'Multiple' is too wordy.
Raw output
{"message": "[write-good.TooWordy] 'Multiple' is too wordy.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 266}}}, "severity": "WARNING"}

Check notice on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[write-good.E-Prime] Try to avoid using 'are'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'are'.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 280}}}, "severity": "INFO"}

Check notice on line 19 in content/docs/platform/sdks/react/hooks/use-notifications.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] content/docs/platform/sdks/react/hooks/use-notifications.mdx#L19

[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'AND', if it's unfamiliar to the audience.", "location": {"path": "content/docs/platform/sdks/react/hooks/use-notifications.mdx", "range": {"start": {"line": 19, "column": 284}}}, "severity": "INFO"}
"type": "Record<string, unknown>"
},
"read": {
Expand Down
Loading