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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@evlop/user-activity-analysis-api

v1.0.7

Published

A TypeScript client library for interacting with the Segment Reach API, providing functionality to track user properties and send templated emails.

Readme

User Activity Analysis API Client

A TypeScript client library for interacting with the Segment Reach API, providing functionality to track user properties and send templated emails.

Installation

npm install @evlop/user-activity-analysis-api

Configuration

Before using the client, you need to create an instance with your API credentials:

import UserActivityAnalysis from '@evlop/user-activity-analysis-api';

const client = new UserActivityAnalysis({
  apiKey: 'your-api-key',
  apiBaseUrl: 'https://segment-reach-api.evlop.com', // Optional: defaults to this URL
  propertiesToTrack: ['name', 'email', 'phone'] // Optional: defaults to these properties
});

// You can update the configuration later if needed
client.updateConfig({
  apiKey: 'new-api-key',
  propertiesToTrack: ['name', 'email', 'phone', 'company']
});

Features

Track User Properties

Update user properties in the system:

await client.setUserProperty('user123', {
  name: 'John Doe',
  email: '[email protected]',
  phone: '+1234567890'
});

Send Templated Emails

Send emails using predefined templates. You can send either by user ID or directly to an email address:

// Send to a user by ID
await client.sendEmail({
  userId: 'user123',
  templateId: 'template-id',
  params: {
    firstName: 'John',
    customData: 'value'
  }
});

// Or send directly to an email address
await client.sendEmail({
  email: '[email protected]',
  templateId: 'template-id',
  params: {
    firstName: 'John',
    customData: 'value'
  }
});

API Reference

new UserActivityAnalysis(config)

Create a new client instance with configuration.

  • config.apiKey (required): Your API key for authentication
  • config.apiBaseUrl (optional): Base URL for the API (defaults to 'https://segment-reach-api.evlop.com')
  • config.propertiesToTrack (optional): Array of property names to track (defaults to ['name', 'email', 'phone'])

client.updateConfig(config)

Update the client configuration.

  • config: Same options as constructor

client.setUserProperty(userId, properties)

Update user properties in the system.

  • userId (required): Unique identifier for the user
  • properties (required): Object containing user properties to update

client.sendEmail(params)

Send a templated email to a user or email address.

  • params (required): Object containing either:
    • userId and templateId for user-based sending
    • email and templateId for direct email sending
    • params: Object containing template parameters

Error Handling

The client includes built-in error handling and will log errors to the console when API calls fail. All methods are safe to call even when the API client is not initialized.

License

MIT