Installation
Prerequisites
To use this package, you need to ensure that the following dependencies are installed:
- React: ^18
- React DOM: ^18
You can install the Vocale library via npm:
npm install @vocale/react
Set Up Vocale Provider: Wrap your application with the VocaleProvider component at the root level to provide Vocale context to all components. Make sure to pass your Vocale settings as props to the provider.
import React from 'react'; import { VocaleProvider } from '@vocale/react'; const settings = { siteId: 'YOUR_SITE_ID', apiKey: 'YOUR_API_KEY', }; function App() { return ( <VocaleProvider {...settings}> {/* Your application components */} </VocaleProvider> ); } export default App;
Start Using Vocale! See the Basic Usage Guide for React to get more information.