SaasHound client for React applications
To install the saashound react.js library, run the following command:
npm install saashound-react
yarn add saashound-react
pnpm install saashound-react
import React from 'react'import { SaasHoundProvider } from 'saashound-react' const App: React.FC = () => ( <SaasHoundProvider token="API_TOKEN" project="PROJECT_NAME"> {/* <App /> */} </SaasHoundProvider>)
import React from 'react'import { useSaasHound } from 'saashound-react' const YourComponent: React.FC = () => { const { logEvent, sendMetric, identify } = useSaasHound() const yourFunction = async () => { await logEvent({ channel: "payments", title: "New Customer", userId: "user-123", icon: "💰", notify: true, tags: { plan: "premium", cycle: "onetime", trial: false } }); // Send Metric await sendMetric({ title: "Users", value: 1254, icon: "👥", increment: false, }); // Identify user await identify({ userId: "user-987", properties: { name: "Al Beback", email: "al@beb.com", plan: "premium", referrals: 12, } }); } return ( // Your component code here )}