Socket
Socket
Sign inDemoInstall

@ingrain/ingrain-react

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

@ingrain/ingrain-react

Ingrain (ingrain.dev) React components for display user activity audit trails


Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

Ingrain React

Overview

This is the React UI Components package for Ingrain.

Ingrain is the fastest and easiest way to integrate activity audit trails in your app. Log a trail of user activities and employ our easy-to-integrate components to display these actions within your app's interface, offering your users a transparent view of their account activities.

Client JS SDK

If you only need the client side SDK, you can check out Ingrain Client SDK.

Getting Started

Prerequisites

  • React v18+
  • Node.js v18+

Installation

npm i @ingrain/ingrain-react

or with yarn:

yarn add @ingrain/ingrain-react

Usage

Ingrain requires your application to be wrapped in the <IngrainProvider/> context.

If using Create React App, set REACT_APP_INGRAIN_PUBLISHABLE_KEY to your publishable key in your .env.local file to make the environment variable accessible on process.env and pass it as the publishableKey prop.

You will also need to obtain and pass in your user's JWT.

import { render } from 'react-dom';

import { IngrainProvider, UserActivity, EntityActivity  } from '@ingrain/ingrain-react';

const publishableKey = process.env.REACT_APP_INGRAIN_PUBLISHABLE_KEY;
const userJwt = getUserJWT(); // Define how you can obtain your user's JWT

render(
  <IngrainProvider
    theme={{ mode: 'light' }} // or set it to dark mode. You can also customize your colors here.
    opts={{
      publishableKey,
      getUserJwtToken: () => {
        return userJwt;
      },
    }}
  >
    <App />
  </IngrainProvider>,
  document.getElementById('root'),
);

function App() {
  return (
    <>
      {/* Activity timeline based on user */}
      <UserActivity userId={'user-id-here'}>
      {/* Activity timeline based on entity e.g. access token changes */}
      <EntityActivity entityId={'entity-id-here'}>
    </>
  );
}

Documentation

You can start from Introduction or jump straight to React UI Components

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contributing guidelines

Keywords

FAQs

Package last updated on 29 Feb 2024

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