npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

grovs

v1.0.1

Published

Grovs generates dynamic links, tracks attributions, and analyzes referrals, seamlessly directing users to your app or the app store for downloads.

Downloads

8

Readme

Grovs SDK Documentation

Overview

The Grovs SDK is a JavaScript module designed to integrate with the Grovs API, providing functionality for creating and managing links, handling user information, and managing authentication. This documentation covers the main methods and usage of the SDK.

Installation

To install the Grovs SDK, use the following command to add it as a dependency to your project:

npm install grovs --save

This will add the Grovs SDK to your dependencies in package.json.

After installation, you can include the SDK in your project:

import Grovs from "Grovs";

Documentation

Constructor

constructor(APIKey, linkHandlingCallback);

Creates a new instance of the grovs SDK.

  • APIKey (string): Your API key provided by grovs for authentication.
  • linkHandlingCallback (Function): A callback function that handles the data received from grovs.

Example

const APIKey = "your-api-key-here";
const handleLinkData = (data) => {
  console.log("Link data received:", data);
};

const grovs = new Grovs(APIKey, handleLinkData);

Methods

start()

Initializes and starts the Grovs SDK by authenticating with the provided API key.

  • succesfullAuthenticatedCallback (Function, optional): Callback to invoke on successful authentication.

Example

grovs.start();

createLink(title, subtitle, imageURL, data, success, error)

Creates a new link using the Grovs API.

  • title (string): The title of the link.
  • subtitle (Function): The subtitle of the link.
  • imageURL (string): The URL of the image associated with the link.
  • data (Object): Additional data to be included with the link.
  • success (Function): A callback function to be invoked upon successful creation of the link.
  • error (Function): A callback function to be invoked if there is an error in creating the link.

Example

const linkData = {
  description: "This is a sample link",
  category: "Demo",
};

grovs.createLink(
  "Sample Link",
  "This is a subtitle",
  "https://example.com/image.jpg",
  linkData,
  (response) => {
    console.log("Link created successfully:", response);
  },
  (err) => {
    console.error("Error creating link:", err);
  }
);

userIdentifier()

Retrieves the current user identifier.

  • Returns (string|null): The user identifier if set, otherwise null.

Example

const userId = grovs.userIdentifier();
console.log("Current user ID:", userId);

userAttributes()

Retrieves the current user attributes.

  • Returns (Object|null): A dictionary of user attributes if set, otherwise null.

Example

const userAttributes = grovs.userAttributes();
console.log("User attributes:", userAttributes);

setUserIdentifier(identifier)

Sets the user identifier.

  • identifier (string): The user identifier to set.

Example

grovs.setUserIdentifier("user-12345");

setUserAttributes(attributes)

Sets the user attributes.

  • attributes (Object): A dictionary of user attributes to set.

Example

const attributes = {
  name: "John Doe",
  email: "john.doe@example.com",
};

grovs.setUserAttributes(attributes);

authenticated()

Checks if the SDK is currently authenticated.

  • Returns (boolean): true if authenticated, false otherwise.

Example

const isAuthenticated = grovs.authenticated();
console.log("Is authenticated:", isAuthenticated);

showMessagesList()

Displays the messages list using the manager.

Example

grovs.showMessagesList();

getMessages(page, response, error)

Retrieves messages for a specific page using the manager.

  • page (number): The page number to retrieve messages from.
  • response (Function): Callback to handle the retrieved messages.
  • error (Function): Callback to handle any errors during retrieval.

Example

grovs.getMessages(
  1,
  (messages) => {
    console.log("Retrieved messages:", messages);
  },
  (err) => {
    console.error("Error retrieving messages:", err);
  }
);

getNumberOfUnreadMessages(response, error)

Retrieves the number of unread messages using the manager.

  • response (Function): Callback to handle the count of unread messages.
  • error (Function): Callback to handle any errors during retrieval.

Example

grovs.getNumberOfUnreadMessages(
  (count) => {
    console.log("Number of unread messages:", count);
  },
  (err) => {
    console.error("Error retrieving unread messages count:", err);
  }
);

Usage Example

import grovs from "grovs";

const APIKey = "your-api-key";
const grovs = new grovs(APIKey, (data) => {
  console.log("Link data:", data);
});

grovs.start();

if (grovs.authenticated()) {
  grovs.createLink(
    "Sample Link",
    "Subtitle",
    "https://example.com/image.jpg",
    { foo: "bar" },
    (response) => console.log("Link created:", response),
    (error) => console.error("Error:", error)
  );
}

grovs.setUserIdentifier("user-123");
grovs.setUserAttributes({ name: "John Doe", age: 30 });

console.log("User ID:", grovs.userIdentifier());
console.log("User Attributes:", grovs.userAttributes());