tantainnovative / intercom-next-js-14-guide

Next.js 14 Intercom Integration: A comprehensive guide and example codebase for seamlessly integrating the Intercom chat widget into Next.js 14 applications, enhancing user engagement and support.
https://tantainnovatives.com/blog/how-to-guides-and-tutorials/how-to-integrate-intercom-in-your-nextjs-14-project
MIT License
4 stars 0 forks source link
app-router-nextjs intercom intercom-client nextjs

Intercom Integration in Next.js 14 (App router)

This project demonstrates how to integrate Intercom chat widget into a Next.js 14 application. It provides a robust setup to add Intercom to your Next.js projects using modern best practices for script loading and initialization.

Prerequisites

Before you begin, ensure you have the following installed on your system:

Additionally, you will need an Intercom account and your Intercom app ID to complete the integration.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installation

  1. Clone the repository:

    git clone https://github.com/tantainnovative/intercom-next-js-14-guide.git
    cd intercom-nextjs-14
  2. Install the dependencies:

    npm install

    or if you use Yarn:

    yarn install
  3. Set up the environment variables:

    Create a .env.local file in the root directory of the project, and add the following line:

    NEXT_PUBLIC_INTERCOM_APP_ID=your_intercom_app_id_here

    Replace your_intercom_app_id_here with your actual Intercom app ID.

Running the Application

To run the application locally:

npm run dev

or if you use Yarn:

yarn dev

This will start the development server on http://localhost:3000. Open this URL in your browser to view the application.

Project Structure

Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Explanation