Skip to content

Npx script that automatically sets up and customizes a Next.js application powered by Stream Chat.

Notifications You must be signed in to change notification settings

GetStream/npx-nextjs-chat-setup-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog-BuildCustom-NPX-Script-2000x840px

NPX Script for a Next.js application powered by Stream Chat

This repository contains the code for an npx script that creates a new Next.js application. It then configures Stream Chat with the React SDK. You can find a written tutorial in the form of a blog post here.

The steps that the script takes are:

  1. Request user info for a project name
  2. Clone the template repository, install its dependencies and initialize a new git project locally
  3. Customize the repository files with custom information that the user can obtain from the Stream Dashboard

How to run it globally

npx @stream-io/create-app react-chat

Running the project

Prerequisites

First, a machine running Node.js and the option to clone the repository. To do a proper setup we will also need a Stream account (which we can get for free here). With that we can create a project on the Stream Dashboard, that we can get the necessary credentials from (see the blog post for more details on that).

Running locally

The first thing to do is install dependencies:

npm install
# or
yarn

Then, we have two options to run the project. The first is by simply calling the script. We can do this with the following command:

node ./setup-script.js

However, we can also register the script in our local npm environment and make it available as an npx command there. For this we first need to link the package locally like this (we need to make sure we are in the root folder of the project for this):

npm link

And then we can run it from anywhere:

npx react-chat

Want to use the Stream SDKs yourself?

You can get started with the Stream SDKs today for free.

Find our React documentation here:

About

Npx script that automatically sets up and customizes a Next.js application powered by Stream Chat.

Topics

Resources

Stars

Watchers

Forks