Code Monkey home page Code Monkey logo

react-in-app-example's Introduction

Courier React In-App Toast Example

This is an example React app bootstrapped with Create React App with Typescript to demo the functionality of the @trycourier/react-toast package.

@trycourier/react-provider is a dependency that handles all the authentication and integration with the Courier backend.

The only other additional dependencies are chakra-ui and Formik which are used to quickly build the demo form that will let you quickly configure and trigger a standalone local notification.

Online Demo

Check it here

You can quickly configure and trigger a simple Toast notification on this page. To test it with your own Courier Push integration you need to quickly clone the repository and run it locally.

Running Locally

Prerequisites to run the app:

  • Node.js
  • yarn

Clone the repository and install the dependencies:

$ yarn install

Start the dev server:

$ yarn start

The app URL will open automatically in your browser.

Configuring Courier Provider

You need to pass the client key you get when installing Courier Push integration and the user id to the Courier Provider component as props to start listening for notifications and to automatically style the toast according to your Courier branding.

You can pass the client key and user id in index.tsx.

Documentation

useToast hook is used to show local standalone toast notifications while the <Toast /> component is there to show the notifications coming from the Courier servers that the Courier Provider is subscribing to.

You can find the full documentation on the component API and usage, as well as, the Courier Push integration testing if you follow this link.

react-in-app-example's People

Contributors

thedonniew avatar tk26 avatar vahnag avatar worldsoup avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.