@strapi-newsletter/react
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Strapi Newsletter React ⚛️

Introduction 📖

Strapi Newsletter React is a ReactJS component and a utility function that will allow a user in your website to subscribe to a newsletter. You have access to a React JS component called <Newsletter /> that will allow you to display a newsletter subscription form and a helper function called subscribeUser if you want to handle the subscription UI yourself.

Installation

Run any of the following commands inside your strapi directory to install the package:

npm i @strapi-newsletter/react

yarn add @strapi-newsletter/react

Usage 💄

  1. React Component ⚛️
import Newsletter from "@strapi-newsletter/react";

const App = () => (
  <Newsletter strapiEndpoint="http://localhost:1337" buttonText="Subscribe" />
);
  1. Helper Function
import { subscribeUser } from "@strapi-newsletter/react";

const handleUserSubscribe = async (email) => {
  await subscribeUser(email, "http://localhost:1337");
};

Readme

Keywords

none

Package Sidebar

Install

npm i @strapi-newsletter/react

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

38.8 kB

Total Files

13

Last publish

Collaborators

  • osadavc