Adds clap button (like medium) to any page for your Next.js apps.

Overview

@upstash/claps

Add a claps button (like medium) to any page for your Next.js apps.

Nothing to maintain, it is completely serverless 💯

Check out the demo.

1. Create Database

Create a free Redis database at Upstash Console

We will use Upstash Redis to keep the data as well as messaging (Redis pub/sub).

2. Environment Variables

Copy the .env.local.example file to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN can be found at the database details page in Upstash Console.

3. Install Package

yarn add @upstash/claps

4. Import CSS

// pages/_app.js
import "@upstash/claps/style.css";

export default function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

4. Import Components

// pages/example.js
import Claps from "@upstash/claps";

export default function Example() {
  return (
    <div>
        <Claps fixed="left">
    </div>
  )
}

The options can be passed as React props

key type default
key? string
fixed? "left", "center", "right"
replyUrl? string
replyCount? string
apiPath? string /api/claps
iconClap? null, React.ReactElement
iconReply? null, React.ReactElement

Url of the page is being used as the key/identity to keep the claps count. You can override this giving the key attribute.

5. Create API

// pages/api/claps.js
import createClapsAPI from "@upstash/claps/api";

const ClapsAPI = createClapsAPI({
 // maxClaps: 10
});
export default ClapsAPI;

Support

Use Upstash Discord channel to get support.

You might also like...

A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.

A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.

Strapi Preview Button A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view. Get Started Features I

Dec 30, 2022

Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

May 18, 2022

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

A set of flat and 3D progress button styles where the button itself serves as a progress indicator

A set of flat and 3D progress button styles where the button itself serves as a progress indicator. 3D styles are used for showing the progress indication on one side of the button while rotating the button in perspective.

Oct 19, 2022

Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback

Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback

Dynamic BS5 Modal Box Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback Insta

Oct 23, 2022

Easiest medium to use buttons with any discord API wrapper

Easiest medium to use buttons with any discord API wrapper

Discord Buttons Plugin Easiest medium to use buttons with any discord API wrapper /* Generate 1st Button with "Yes" lable on it */ const button1

May 14, 2022

An extension that adds an "edit tags" button to every object on osm.org

An extension that adds an

OpenStreetMap Tags Editor This is a WebExtension that adds an "Edit Tags" button to all node, way, and relation pages on the osm.org website. The butt

Dec 1, 2022

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Dec 26, 2022

Medium-Clone with Next.JS, Typescript, Tailwindcss, and Sanity!!

Medium-Clone with Next.JS, Typescript, Tailwindcss, and Sanity!!

Medium Clone 📌 Overview /pages ✔️ pages/index.tsx = Homepage and list all Blogs ✔️ pages/post/[slug].tsx = Details Blog /pages/api ✔️ pages/api/creat

Nov 16, 2022

Medium.com (Redesign with Next.js & Tailwindcss)

 Medium.com (Redesign with Next.js & Tailwindcss)

Medium.com (Redesign with Next.js & Tailwindcss) It is a redesign of the popular blogging website Medium.com. It is designed with React and Tailwindcs

Jun 11, 2022

Finally, a "back to top" button that behaves like a real elevator.

elevator.js Finally, a "back to top" button that behaves like a real elevator, by adding elevator music to quietly soothe the awkwardness that can ens

Dec 27, 2022

Hey There! 🙌 🤾 that ⭐️ button if you like this boilerplate.

Hey There! 🙌  🤾 that ⭐️ button if you like this boilerplate.

Hey There! 🙌 🤾 that ⭐️ button if you like this boilerplate. A boilerplate for Node.js App. Contents Global Requisites App Structure Install, Conf

Dec 5, 2022

pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles, and a working back button.

pjax = pushState + ajax pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles,

Jan 5, 2023

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

If you would be interested in helping to maintain one of the most successful WYSIWYG text editors on github, let us know! (See issue #1503) MediumEdit

Jan 4, 2023

Read Medium content without limit!

Read Medium content without limit!

Medium Unlocker Read Medium content without limit! Aka replacer for Medium Unlimited. Get more information Please visit Wiki page Features Unlock grap

Dec 24, 2022

Simple Rest API to retrieve medium stats of a user's stories.

Simple Rest API to retrieve medium stats of a user's stories.

Advanced Medium API Contents Overview API Details Medium feed in JSON Medium Advanced Data Medium Customized Data Medium Customized Advanced Data Miss

Jun 5, 2022
Comments
  • refactor component (claps)

    refactor component (claps)

    Removed undefined and null types from optional parameters. Because these parameters may not be sent at all.

    Improved handling of classnames.

    Some ternary operator uses have been simplified.

    opened by aykutkardas 0
Owner
Upstash
Serverless Data for Redis and Kafka
Upstash
⚙️ Offline-capable Astro apps via SWSR (Service Worker Side Rendering)

Astro-service-worker ⚙️ Offline-capable Astro apps via SWSR (Service Worker Side Rendering) astro-service-worker will take your Astro SSR project, and

Pascal Schilp 41 Dec 4, 2022
Serverless URL Shortener made with Next.js + Redis.

linki: a place for your links linki is a url shortener made with next.js and redis! built with simplicity in mind, it's all in one page. deploy your o

Jack Reiker 12 Sep 15, 2022
generate statistics on the number of audience minutes your site is generating, and if readers make it to the end of your screeds

audience-minutes generate statistics on the number of audience minutes your site is receiving, and if readers make it to the end of your screeds. “If

bert hubert 35 Dec 28, 2022
Build and deploy a roadmap voting app for your porject

Roadmap Voting App You can deploy Roadmap application yourself and get feedback from your users about your roadmap features. See the live example. In

Upstash 91 Jan 3, 2023
Making service workers easy so that your app is fast and reliable, even offline.

tulo.js Making service workers easy to use so that your app can be fast and reliable, even offline. Welcome to tulo.js, a service worker library that

OSLabs Beta 37 Nov 16, 2022
⚡️ Supercharge your ViewComponent development process 🚀

L ?? kbook ⚡️ Supercharge your ViewComponent development process ?? About Lookbook provides a ready-to-go UI for navigating, inspecting and interactin

Mark Perkins 466 Dec 26, 2022
Out of the box modern User Interface, so you can see and manage your Workhorse jobs in realtime

WORKHORSE UI Out of the box modern User Interface, so you can see and manage your Workhorse jobs in realtime. Start local Run npm i Copy and name prox

Workhorse 2 Apr 15, 2022
Build your Cloudflare Workers with esbuild.

build-worker Bundle your Cloudflare Worker with esbuild instead of webpack. (It's ridiculously faster!) Wrangler v1 uses webpack. Wrangler v2 is using

Rom 7 Oct 24, 2022
A Remix.run stack to monitor your BullMQ queues

Remix Matador stack A bold interface that helps you monitor your BullMQ queues. Learn more about Remix Stacks. $ npx create-remix@latest --template nu

Andrea 19 Dec 15, 2022
A bot that notifies you on Slack whenever your company/product is mentioned on Hacker News. Powered by Vercel Functions & Upstash.

Hacker News Slack Bot A bot that notifies you on Slack whenever your company/product is mentioned on Hacker News. or deploy your own Built With Vercel

Vercel Labs 162 Jan 3, 2023