How to Integrate an NPM Package
Add the Grovs SDK to your web project using npm.
npm is the standard package manager for JavaScript and TypeScript web projects. Follow these steps to integrate the Grovs SDK.
1
Initialize your project
If you haven't already initialized your project, create a package.json file:
Bash
npm init -yFor existing projects, skip this step.
2
Install the Grovs package
Use npm to install the Grovs SDK:
Bash
npm install grovsnpm will download the package and add it to your package.json dependencies.
3
Import the package
In your JavaScript or TypeScript files, import Grovs using the appropriate syntax for your environment:
const Grovs = require('grovs');If you are using a bundler like Webpack, Vite, or Parcel, imports are handled automatically during the build process.
4
Use the SDK
Once imported, initialize the Grovs SDK in your application:
// Initialize Grovs with your configuration
Grovs.initialize({
apiKey: 'your-api-key',
// Additional configuration options
});