npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@moebel.de/usercentrics-client

v4.5.0

Published

Usercentrics is a consents management service for GDPR. You can setup your users privacy configs via [UC panel](usercentrics.eu). Each app/domain should have a separate set up in the UC panel. Each app/domain identify by its `SETTING ID`.

Downloads

115

Readme

Usercentrics Client

Usercentrics is a consents management service for GDPR. You can setup your users privacy configs via UC panel. Each app/domain should have a separate set up in the UC panel. Each app/domain identify by its SETTING ID.

UC client is a React.js component that only needs your UC SETTING_ID for loading/showing/managing your GDPR stuff. This component use React context for providing all data and configs that client needs from UC.

This client support two main types of UC UI appearance, banner and wall. The default appearance is wall but you can change it by setting the appearance value to banner in the UC provider component options prop.

You also can control the content language by setting your language code in options prop. Most of the translations come from UC configs which you can edit them in the dashboard. But we have a small util function for handling those texts translations that are not part of UC base config and we add them to the UI. For now the component support 5 languages in i18n util function which you can see a usage of it in AcceptAndCloseCTA component. AcceptAndCloseCTA component is not part of UC general UI. It is a good example of what you can do with this library in compare of UC general UI library regarding customisation level.

Usage

You just need to install the client and then import the data provider and UI component in your app.

npm install @consumer/usercentrics-client
import { UsercentricsProvider, Usercentrics } from '@consumer/usercentrics-client';
import dynamic 'next/dynamic';

const DynamicUsercentrics = dynamic({
  loader: import('@consumer/usercentrics-client').then(mod => mod.Usercenrtrics),
  ssr: false, // Never load this on server side
})

const App = () => {
  return (
    <UsercentricsProvider settingId="SETTING_ID">
      <Usercentrics />
    </UsercentricsProvider>
  );
};

Development

This library created on top of TSDX. There are a few npm scripts that help you to develop and build the library:

  • start: watches files and build development bundle
  • build: buils production bundle

For developing the library you also have access to a simple Next.js app in the example directory. Example app uses relative-deps to link the library. After a new build of the library, run yarn prepare inside the example folder to update the library for the example.

  • Inside of ./example run yarn
  • Run yarn build then yarn start
  • Open the localhost address displayed in the console

Release notes / semantic versioning

Make sure to follow these commit message conventions. To get a preview of how the upcoming release notes and the new version number will look run npx semantic-release --dry-run.

Deploying

During development to test in frontend

Use yarn link to link the packages locally.

  1. Run yarn link inside this project
  2. Run yarn build
  3. Switch to where you want to use the package. For example to end-user-frontend-monorepo. Run yarn link @moebel.de/usercentrics-client in there

Afterwards you should run yarn unlink @moebel.de/usercentrics-client

Further reading: yarn docs

Before merging to master

Semantic-release can take care of the npm release if you follow conventional commits rules. After adding changes to git staging, create a git commit according to Conventional Commits.