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

@snapcall/agent-app-react

v1.5.0

Published

The SnapCall Agent App is a react component that will help you integrate SnapCall to receive calls.

Readme

SnapCall Agent App React

The SnapCall Agent App is a react component that will help you integrate SnapCall to receive calls.

This component is using the SnapCall widget API, and need a working react environment like this one.

Installation

npm install @snapcall/agent-app-react

Basic usage

import { AgentApp } from '@snapcall/agent-app-react';

const App = () => (
  <AgentApp apiKey="123" agentEmail="[email protected]" />
);

Props

AgentApp

| Name | Type | Description | --- | --- | --- | | apiKey | string | Your SnapCall API key | agentEmail | string | The email of the agent receiving calls | snapcalljsUrl | ?string | A custom URL for the SnapCall Widget SDK script | onDisconnect | ?() => void | Event triggered when the agent got disconnected | onReconnect | ?() => void | Event triggered when the agent got reconnected | onClientLostConnection | ?() => void | Event triggered when the client lost connection | onClientWeakNetwork | ?() => void | Event triggered when the client network is weak | onAgentMicrophoneDown | ?() => void | Event triggered when the agent microphone is down | onAgentMicrophoneUp | ?() => void | Event triggered when the agent microphone is up | loadingView | ?() => ReactNode | View used for loading | waitingView | ?({ resetWrapUpTime: Function, wrapUpTimeLeft: number, startOutboundCall: Function, VideoPreview: ReactNode }) => ReactNode | View used when the agent is waiting for a call (ready) | ringingView | ?({ answer: Function, decline: Function, callID: string, VideoPreview: ReactNode }) => ReactNode | View used when the agent is receiving a call | inCallView | ?({ hangUp: Function, toggleHold: Function, timer: number, Video: ReactNode }) => ReactNode | View used when the agent is in call | errorView | ?({ error: string }) => ReactNode | View used when a blocking error occurs

Waiting view

Parameters available in the WaitingView component:

| Name | Type | Description | --- | --- | --- | | resetWrapUpTime | () => void | Alias for snapcallAPI.resetWrapUpTime | wrapUpTimeLeft | number | Seconds left until wrap up time is over | startOutboundCall | ({ phoneNumber: string }) => void | Start an outbound call on the provided phone number

Ringing view

Parameters available in the RingingView component:

| Name | Type | Description | --- | --- | --- | | answer | () => void | Function to answer the call | decline | () => void | Function to decline the call | callID | string | The ID of the ringing call

In Call View

Parameters available in the InCallView component:

| Name | Type | Description | --- | --- | --- | | hangUp | () => void | Function to hang up the call | toggleHold | () => void | Function to put the call on hold or to resume it | timer | number | Seconds since the call started | Video | ReactNode | See Video component details below

Video

The Video component is available as a props for the inCallView.

| Name | Type | Description | --- | --- | --- | | timer | ?number | If set, will display the call timer on top of the video element | hideControls | ?boolean | Whether the control buttons should be displayed or not

Example

import { AgentApp } from '@snapcall/agent-app-react';

const RingingView = ({ answer, decline, callID }) => (
  <div>
    <p>A call is coming! (ID: {callID})</p>
    <button onClick={answer}>Answer</button>
    <button onClick={decline}>Decline</button>
  </div>
);

const InCallView = ({ hangUp, timer, Video }) => (
  <div>
    <Video timer={timer} />
    <button onClick={hangUp}>Hang up</button>
  </div>
);

const App = () => (
  <AgentApp
    apiKey="123"
    agentEmail="[email protected]"
    ringingView={RingingView}
    inCallView={InCallView}
    onClientLostConnection={() => console.log('The client lost the connection!!')}
  />
);