@cntm-labs/nucleus-react
v0.3.0
Published
Nucleus authentication SDK for React.
Maintainers
Readme
@cntm-labs/nucleus-react
Nucleus authentication SDK for React SPAs.
Warning: DEV PREVIEW — This package is under active development and is NOT ready for production use. APIs may change without notice. For updates, watch the Nucleus repo.
Provider component and hooks for session and user state.
Part of Nucleus — high-performance, self-hosted auth platform.
Installation
npm i @cntm-labs/nucleus-reactQuick Start
import { NucleusProvider, useAuth } from '@cntm-labs/nucleus-react';
function App() {
return (
<NucleusProvider publishableKey="pk_...">
<MyApp />
</NucleusProvider>
);
}
function MyApp() {
const { isSignedIn, user } = useAuth();
return <div>{isSignedIn ? `Hello ${user.email}` : 'Sign in'}</div>;
}