Skip to content

Conversation

@smeijer
Copy link
Member

@smeijer smeijer commented Jun 18, 2024

Breaking Change!

We've renamed the categories property to category and the topics property to topic, to reflect that these properties only support a single value. We haven't been supporting multiple categories or topics for a while now, and believe that renaming this property is the right thing to do. It requires a small change on your end, but the clear naming reduces the number of potential bugs caused by misunderstanding.

If you make use of different stores or tabs using the categories or topics properties, you'll need to rename them to their singular variants.

import MagicBell, { FloatingNotificationInbox } from '@magicbell/magicbell-react';
import React from 'react';

const stores = [
  { id: 'default', defaultQueryParams: {} },
  { id: 'unread', defaultQueryParams: { read: false } },
-  { id: 'billing', defaultQueryParams: { categories: ['billing'] } },
+  { id: 'billing', defaultQueryParams: { category: 'billing' } },
-  { id: 'support', defaultQueryParams: { topics: ['support'] } },
+  { id: 'support', defaultQueryParams: { topic: 'support' } },
];

const tabs = [
  { storeId: 'default', label: 'Latest' },
  { storeId: 'unread', label: 'Archive' },
  { storeId: 'billing', label: 'Billing' },
  { storeId: 'support', label: 'Issues' },
];

export default function Index() {
  return (
    <MagicBell
      apiKey="__MAGICBELL_API_KEY__"
      userEmail="__MAGICBELL_USER_EMAIL__"
      userKey="__MAGICBELL_USER_KEY__"
      stores={stores}
      defaultIsOpen
    >
      {(props) => <FloatingNotificationInbox height={450} tabs={tabs} {...props} />}
    </MagicBell>
  );
}

Likewise, when you filter notifications using our cli, you might need to change some arguments:

- magicbell user list notifications --topics support
+ magicbell user list notifications --topic support

- magicbell user notifications mark-all-read --topics billing
+ magicbell user notifications mark-all-read --topic billing

- magicbell user notifications mark-all-seen --topics other
+ magicbell user notifications mark-all-seen --topic other

@vercel
Copy link

vercel bot commented Jun 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 9:44am

@smeijer smeijer changed the title fix: don't override spec url feat: rename categories > category and topics > topic Jun 18, 2024
Base automatically changed from feature/magicbell to main June 18, 2024 14:29
@smeijer smeijer force-pushed the feature/category-and-topic branch from 7561051 to 8a7aac3 Compare June 18, 2024 14:42
@smeijer smeijer marked this pull request as draft June 18, 2024 14:51
@smeijer smeijer self-assigned this Jul 10, 2024
@smeijer smeijer force-pushed the feature/category-and-topic branch from 8a7aac3 to 98fb87a Compare August 30, 2024 09:41
@smeijer smeijer marked this pull request as ready for review August 30, 2024 09:46
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 30, 2024

commit: 98fb87a

@magicbell/cli

yarn add https://pkg.pr.new/@magicbell/cli@299

@magicbell/core

yarn add https://pkg.pr.new/@magicbell/core@299

@magicbell/embeddable

yarn add https://pkg.pr.new/@magicbell/embeddable@299

@magicbell/in-app

yarn add https://pkg.pr.new/@magicbell/in-app@299

magicbell

yarn add https://pkg.pr.new/magicbell@299

@magicbell/project-client

yarn add https://pkg.pr.new/@magicbell/project-client@299

@magicbell/magicbell-react

yarn add https://pkg.pr.new/@magicbell/magicbell-react@299

@magicbell/react-headless

yarn add https://pkg.pr.new/@magicbell/react-headless@299

@magicbell/user-client

yarn add https://pkg.pr.new/@magicbell/user-client@299

@magicbell/webpush

yarn add https://pkg.pr.new/@magicbell/webpush@299

Open in Stackblitz

@smeijer smeijer merged commit df2c87f into main Aug 30, 2024
@smeijer smeijer deleted the feature/category-and-topic branch August 30, 2024 10:00
@MagicBella MagicBella mentioned this pull request Aug 30, 2024
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