
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
@trycourier/react-inbox
Advanced tools
Courier React Inbox is a react component that you can add to your application show your users a list of recent messages they have received over a push
channel.
Upcoming Features:
read
/unread
unread
The react inbox requires a backend to pull messages. This is all done magically through the CourierProvider
and requires an account at Courier.
As of right now, we will fetch all messages sent to any push
channel and display them in the inbox
.
yarn add @trycourier/react-inbox
In order for the Toast
component to be placed in the dom you will need to use the ToastProvider
. This will handle context and give us access to the show
function.
The component you want to listen to toasts from must be a child of the
ToastProvider
. Check here for more information on this concept.
//App.js
import { Inbox, CourierProvider } from "@trycourier/react-inbox";
/*
alternatively you can access from its own package
import { CourierProvider } from "@trycourier/react-provider";
*/
function App() {
return (
<CourierProvider clientKey="my-client-key">
<Inbox />
</CourierProvider>
);
}
You can access your client key here
To let your inbox listen for new messages, you will need to add a transport
. Using the courier transport
will automatically handle the listening, and invocation through web sockets
import {
CourierProvider,
CourierTransport,
Inbox,
} from "@trycourier/react-inbox";
const courierTransport = new CourierTransport();
function MyComponent() {
useEffect(() => {
courierTransport.subscribe("YOUR_CHANNEL", "YOUR_EVENT");
// It is good practice to unsubscribe on component unmount
return () => courierTransport.unsubscribe("YOUR_CHANNEL", "YOUR_EVENT");
}, []);
return (
<CourierProvider transport={courierTransport} clientKey="my-client-key">
<Inbox />
</CourierProvider>
);
}
Key | Type | Description |
---|---|---|
config | InboxConfig | See Inbox Config |
title | string | Title of the Inbox |
theme | Theme | Theme object used to override base styles |
renderIcon | FunctionComponent | Override Indicator Icon Component |
renderHeader | FunctionComponent | Override Header Component |
renderMessage | FunctionComponent | Override Message Component |
renderFooter | FunctionComponent | Override Footer Component |
Key | Type | Description |
---|---|---|
defaultIcon | `string | false` |
FAQs
Unknown package
We found that @trycourier/react-inbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.