Socket
Socket
Sign inDemoInstall

@knocklabs/react-feed

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knocklabs/react-feed

Activity feed components for Knock


Version published
Maintainers
2
Created
Source

Knock React Feed

Usage

import {
  KnockProvider,
  FeedProvider,
  NotificationBadge,
  useFeedToken,
} from "@knocklabs/react-feed";

function App() {
  return (
    <KnockProvider apiKey={process.env.KNOCK_API_KEY}>
      <MyComponent />
    </KnockProvider>
  );
}

function MyComponent() {
  const currentUser = useCurrentUser();
  const feedToken = useFeedToken(process.env.KNOCK_FEED_ID, currentUser.id);

  return (
    <header>
      <FeedProvider token={feedToken}>
        <NotificationBadge>
          {({ onClose }) => (
            <ActivityFeed
              onActivityClick={() => {
                onClose();
              }}
            />
          )}
        </NotificationBadge>
      </FeedProvider>
    </header>
  );
}

Development

To start up the build process in order to work with the library locally, either in the example repo, or by linking elsewhere:

  1. git clone git@github.com:knocklabs/react-feed.git && cd react-feed
  2. npm i
  3. npm run dev

Example

There's an example application that you can load in your browser for local development under the example/ directory.

  1. cd example
  2. yarn
  3. yarn run start

It's set to point to localhost:4000, which is the dev instance of the Knock API.

Keywords

FAQs

Package last updated on 17 Dec 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc