Strapi Phone Validator 5

Strapi Phone Validator 5

By Sorin

About Strapi Phone Validator is a powerful and easy-to-use plugin designed to validate phone numbers in various formats. With support for international phone numbers, it offers comprehensive validation to ensure the accuracy of user-provided phone data in your applications.

Latest version

v1.0.0

released October 3, 2025

npm install strapi-phone-validator-5

Strapi-Phone-Validator

Strapi Phone Validator

NPM Version GitHub Stars Strapi v5 Compatible Seamless Strapi Design Translations Included


Strapi Phone Validator is an updated and improved version of strapi-phone-validator, now fully compatible with Strapi v5.
It provides seamless integration into the Strapi admin panel with a UI that matches the Strapi design system and includes built-in support for translations.

This plugin allows you to easily validate phone numbers in multiple formats, including full international support, ensuring accuracy and consistency for phone data in your applications.

It integrates the powerful React International Phone library for modern and flexible input handling.

❗ Requirements

  • Strapi v5

🔧 Installation

You just need to install the strapi-phone-validator-5 package via npm or yarn, at the root of your strapi project.

npm:

npm i strapi-phone-validator-5

yarn:

yarn add strapi-phone-validator-5

✨ Usage

Create a custom field for a phone number on content type builder page.

Preview

Now you can use Strapi Phone Validator as a custom field.

Preview

To make Strapi Phone Validator work, you should take a look at the next section.

After restarting your Strapi app, Strapi Phone Validator should be listed as one of your plugins.

🚀 Strapi Configuration (required)

Allow Strapi Phone Validator assets to be loaded correctly by customizing the strapi::security middleware inside ./config/middlewares.js.

Instead of:

export default [
  // ...
  'strapi::security',
  // ...
];

Write:

export default [
  // ...
    {
        name: "strapi::security",
        config: {
        contentSecurityPolicy: {
            useDefaults: true,
            directives: {
            "connect-src": ["'self'", "https:"],
            "script-src": ["https://cdnjs.cloudflare.com"],
            "media-src": ["https://cdnjs.cloudflare.com"],
            "img-src": ["https://cdnjs.cloudflare.com"],
            },
        },
        },
    },
  // ...
];

Submit your content

Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.

Submit
Submit your content