1.0.3 • Published 1 year ago

browserconfig.xyz v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

npm.io

Hooks for getting the browser config of a visitor of your website. A user can set it's config at https://browserconfig.xyz, and by using this package you have an easy hook for accesing the user's config.

Installation

Install browserconfig and it's dependencies

npm install browserconfig.xyz react-query

Then you need to set up react-query, like this

import { QueryClient, QueryClientProvider } from 'react-query';
const queryClient = new QueryClient();

And wrap your app like this

<QueryClientProvider client={queryClient}>{your app}</QueryClientProvider>

Documentation

const yourDomain = 'google.com';
const { data: browserConfig } = useBrowserConfig(yourDomain);

the variable browserConfig now contains the value that the user configured on browserconfig.xyz!