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:
- Request user info for a project name
- Clone the template repository, install its dependencies and initialize a new
git
project locally - Customize the repository files with custom information that the user can obtain from the Stream Dashboard
npx @stream-io/create-app react-chat
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).
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
You can get started with the Stream SDKs today for free.
Find our React documentation here: