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

jovo-component-get-phone-number

v3.0.2

Published

The component provides a prepackaged solution to get your user's phone number.

Downloads

2

Readme

Jovo Conversational Component: GetPhoneNumber

Getting Started

The component provides a prepackaged solution to get your user's phone number.

Find out more about Jovo's Conversational Components

Installation

You can install the component using npm:

$ npm install --save jovo-component-get-phone-number

After that, you use the Jovo CLI to transfer the component's files to your project using te load command:

$ jovo load jovo-component-get-phone-number

Last but not least you have to include the component in your app.js:

// @language=typescript
// src/app.ts

import { GetPhoneNumber } from './components/jovo-component-get-phone-number';

app.useComponents(new GetPhoneNumber());

// @language=javascript
// src/app.js

const { GetPhoneNumber } = require('../components/jovo-component-get-phone-number/index');

app.useComponents(new GetPhoneNumber());

Sample Dialog

SSML tags are not included in sample dialogs, but might be included in the responses.

| User | Alexa Speech | Alexa Reprompt | Keys | | --------------- | ------------------------------------------- | ------------------------------------------- | ---------------------------------- | |   | Please tell me your phone number. |   | start-question | | It's 0123456789 |   |   |   | |   | OK, I got {{phoneNumber}}. Is that correct? | Is your phone number really {{phoneNumber}} | confirm-question, confirm-reprompt | | Yes. |   |   |   |

| User | Alexa Speech | Alexa Reprompt | Keys | | --------------- | ---------------------------------------------------- | ------------------------------------------------ | ---------------------------------- | |   | Please tell me your phone number. |   | start-question | | It's 0123456789 |   |   |   | |   | OK, I got {{phoneNumber}}. Is that correct? | Is your phone number really {{phoneNumber}} | confirm-question, confirm-reprompt | | No |   |   |   | |   | Alright, let's try again. What is your phone number? | Please tell me your phone number digit by digit. | confirm-reject, reprompt | | It's 0123456789 |   |   |   | |   | OK, I got {{phoneNumber}}. Is that correct? | Is your phone number really {{phoneNumber}} | confirm-question, confirm-reprompt | | Yes. |   |   |   |

| User | Alexa Speech | Alexa Reprompt | Keys | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------ | |   | Alright, let's try again. What is your phone number? | Please tell me your phone number digit by digit. | confirm-reject, reprompt | | It's 0123456789 |   |   |   | |   | OK, I got {{phoneNumber}}. Is that correct? | Is your phone number really {{phoneNumber}} | confirm-question, confirm-reprompt | | No |   |   |   | |   | Unfortunately, I have some problems understanding your phone number. Let's slow down, please tell me the first three digits of your number. |   | sequence-start | | 012 |   |   |   | |   | I got {{sequence}}. Is that correct? |   | sequence-confirm-question | | Yes |   |   |   | |   | Great! Please continue with the next three digits of your phone number. | Please tell me the next three digits of your phone number. | sequence-question, sequence-reprompt | | 345 |   |   |   | |   | I got {{sequence}}. Is that correct? |   | sequence-confirm-question | | Yes |   |   |   | |   | Great! Now tell me the last four digits please. | Tell me the last four digits of your phone number please. | sequence-last-digits-question, sequence-last-digits-reprompt | | 6789 |   |   |   | |   | I got {{sequence}}. Is that correct? |   | sequence-confirm-question | | Yes |   |   |   |

| User | Alexa Speech | Alexa Reprompt | Keys | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ---------------------------------- | |   | Alright, let's try again. What is your phone number? | Please tell me your phone number digit by digit. | confirm-reject, reprompt | | It's 0123456789 |   |   |   | |   | OK, I got {{phoneNumber}}. Is that correct? | Is your phone number really {{phoneNumber}} | confirm-question, confirm-reprompt | | No |   |   |   | |   | Unfortunately, I have some problems understanding your phone number. Let's slow down, please tell me the first three digits of your number. |   | sequence-start | | 012 |   |   |   | |   | I got {{sequence}}. Is that correct? |   | sequence-confirm-question | | No |   |   |   | |   | Oh, sorry! Could you say these digits again? |   | sequence-confirm-reject |

<---> continue just like in dialog #3 <--->

Response

The component's $response has the following interface:

{
    status: "SUCCESSFUL" | "REJECTED" | "ERROR",
    data: {
        phoneNumber: "string" // E164 format
    }
}

The data property will only be defined, if the component was successful!

Find out more about Conversational Component's responses

Configuration

The component only provides one option you can configure. It's the numberOfFails property, determining when the component should switch to the sequence mode, where it asks the user to input their phone number in a sequence of 3 digits, instead of the whole number at once.

Inside your project's config.js override the default value, which is 3:

// config.js

module.exports = {
  // ...
  components: {
    'jovo-component-get-phone-number': {
      numberOfFails: 5,
    },
  },
};

Find out more about Conversational Component's configuration