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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-audio-assistant

v1.0.2

Published

React component for web audio navigation and audio utilities

Downloads

97

Readme

React Audio Assistant npm version npm package

This packages' purpose is to enable audio navigation and interaction in your website/webapp.

As Siri or Google Assistant are to the smartphone, so is this to the web.

This package is heavily dependent on DialogFlow.

An option to integrate with redux is also present.

WARNING: Experimental technology

This package is currently only working on the Chrome Browser. Other browsers are yet to give support to the Web Speech Recognition API that has been in development for quite some time.

Instructions

  1. The first step in the process is to create an account at DialogFlow and configure an agent suited for your website/webapp).
  2. Get the client access token for your DialogFlow app to use later in this package.
  3. yarn add react-audio-assistant or npm i --save react-audio-assistant
  4. Import the component and use it where you want in the page (the component is fixed positioned).

Creating a DialogFlow Agent

Head over to DialogFlow and create your account.

After this is done, create a new agent (which requires you to create a new project on google console too).

Now is the time to create an Intent. Intents are the building blocks of logic for our application navigation.

Intent Creation

Then enter in the intent details screen and configure the intent to suit your needs. In this example case, we are using a Navigate Intent, because we want to navigate our website using our voice.

Intent Creation

Intent Creation

You also need an entity to identify the query you want. Create an Entity.

Intent Creation

Enter in the entity details screen and configure your entity accordingly, training it a bit too in the process.

Intent Creation

After all this is done, access the settings page for the project and copy the client access token, you will need it to make the requests to the platform.

Intent Creation

Demo Project

A demo project is available here.

Example

A simple use case without Redux:

import React, { Component } from 'react';
import { ReactAudioAssistant } from 'react-audio-assistant';

export default class YourComponent extends Component {
    render() {
        return (
            <div>
                <p>This is a div with my custom component stuff</p>
                <ReactAudioAssistant
                    token={YOUR_DIALOG_FLOW_TOKEN}
                    navigate={(target) => console.log(target)}/>
            </div>
        );
    }
}

A simple use case with Redux:

// somewhere in your components
import React, { Component } from 'react';
import { ReactAudioAssistantWithRedux } from 'react-audio-assistant';

export default class YourComponent extends Component {
    render() {
        return (
            <div>
                <p>This is a div with my custom component stuff</p>
                <ReactAudioAssistant
                    token={YOUR_DIALOG_FLOW_TOKEN}
                    navigate={(target) => console.log(target)}/>
            </div>
        );
    }
}

// in your main reducer
import { combineReducers } from 'redux';
import { audioAssistant } from 'react-audio-assistant';

export default combineReducers({
    audioAssistant,
});

License

MIT