xc-clerk-react

0.0.6 • Public • Published

CrossClassify & Clerk React SDK

The CrossClassify & Clerk SDK for react apps, which helps to collect metadata of users activity like page navigation and form interactions.

Prerequisites

  • node 18 (or later)

SDK Integration Guide

First, install xc-clerk-react as a dependency:

npm install --save xc-clerk-react

Step 1: Setup the environments

Setup the environments in the .env file:

  • VITE_CROSS_CLASSIFY_PUBLISHABLE_SITE_ID: you're CrossClassify project site id.
  • VITE_CROSS_CLASSIFY_PUBLISHABLE_API_KEY: you're CrossClassify project api key.
  • VITE_CLERK_PUBLISHABLE_KEY: you're Clerk project key.

Step 2: Handle Provider

Render components in every where that you want to use it.

import { ClerkProvider } from '@clerk/clerk-react'

// Import your publishable key
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY

if (!PUBLISHABLE_KEY) {
    throw new Error("Missing Publishable Key")
}

ReactDOM.createRoot(document.getElementById('root')).render(
    <React.StrictMode>
        <ClerkProvider publishableKey={PUBLISHABLE_KEY}>
            <App />
        </ClerkProvider>
    </React.StrictMode>,
)

Step 3: Render modules

Render components in every where that you want to use it.

import { SecureSignIn, SecureSignUp } from "xc-clerk-react";

const SignInPage = () => (
    <SecureSignIn />
);

const SignUpPage = () => (
    <SecureSignUp />
);

export default SignInPage;

Now go to dashboard and check if your signup submits are shown up in the "Registrations" menu. Congratulations! You're done!

Readme

Keywords

Package Sidebar

Install

npm i xc-clerk-react

Weekly Downloads

2

Version

0.0.6

License

ISC

Unpacked Size

7.48 kB

Total Files

7

Last publish

Collaborators

  • danial2742