This Ably and Next.js fundamentals starter kit demonstrates using some of the Ably's core functionality with Next.js. You can build features and use cases upon these fundamentals such as notifications, activity streams, chat, realtime visualisations and dashboards, and collaborative multiplayer experiences.
The Ably fundamentals demonstrated within this repo are:
- Token Authentication - authenticate and establish a persistent bi-direction connection to the Ably platform.
- Pub/Sub (Publish/Subscribe) - publish messages on channels and subscribe to channels to receive messages.
- Presence - keep track of devices that are present on a channel. This is great for tracking if a device is online or offline or indicating if a user is in a chat room when using Ably for Chat.
- History - Retrieve a history of messages that have been published to a channel.
The project uses the following components:
- Next.js, a flexible React framework that gives you building blocks to create fast web applications.
- Ably, for realtime messaging at scale.
- Sign up or log in to ably.com, and create a new app and copy the API key.
- To deploy to Vercel, create a Vercel account.
Create a .env.local
file with your Ably API key:
echo "ABLY_API_KEY={YOUR_ABLY_API_KEY_HERE}">.env
npm run dev
# or
yarn dev
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Want to help contributing to this project? Have a look at our contributing guide!