A simple way to sell access to your Next.js App, built with the Whop SDK
This is a Next.js project created using the
First, set the required environment variables:
NEXT_PUBLIC_WHOP_CLIENT_ID="WHOP CLIENT ID"WHOP_CLIENT_SECRET="WHOP CLIENT SECRET"WHOP_API_KEY="WHOP API KEY"NEXTAUTH_URL="http://localhost:3000"NEXTAUTH_SECRET="NEXTAUTH SECRET"NEXT_PUBLIC_RECOMMENDED_PLAN_ID="PLAN ID"NEXT_PUBLIC_REQUIRED_PRODUCT="PRODUCT ID"
Many of the environment variables can be found here
Pull your reposity
Then, install node modules:
pnpm i
Then, run the development server:
pnpm run dev
Open http://localhost:3000 with your browser to see the result.
This template offers examples on how to utilize next.js patterns in conjuction with
@whop-sdk/core
/pages
The examples in this list show how to use
getServerSideProps
pages
pages/ssr/index.tsx
User
pages/ssr/logged-in.tsx
/ssr
pages/ssr/product-gated.tsx
Product
/pages
pages/ssg/product-gated.tsx
middleware
Product
middleware
/app
The examples in this list show how to use
@whop-sdk/core
app
next@13.0.0
app/app/ssr/page.tsx
page
app/app/ssr/product-gated/layout.tsx
layout
app/app/ssr/product-gated/page.tsx
page
layout
app/app/ssr/product-gated/layout.tsx
app/app/ssg/product-gated/page.tsx
page
middleware
pages/ssg/product-gated.tsx
/api
pages/api/product-gated.ts
api route
UserService
To learn more about Next.js, take a look at the following resources:
You can check out this templates' GitHub repository - your feedback and contributions are welcome!
A simple way to sell access to your Next.js App, built with the Whop SDK
This is a Next.js project created using the
First, set the required environment variables:
NEXT_PUBLIC_WHOP_CLIENT_ID="WHOP CLIENT ID"WHOP_CLIENT_SECRET="WHOP CLIENT SECRET"WHOP_API_KEY="WHOP API KEY"NEXTAUTH_URL="http://localhost:3000"NEXTAUTH_SECRET="NEXTAUTH SECRET"NEXT_PUBLIC_RECOMMENDED_PLAN_ID="PLAN ID"NEXT_PUBLIC_REQUIRED_PRODUCT="PRODUCT ID"
Many of the environment variables can be found here
Pull your reposity
Then, install node modules:
pnpm i
Then, run the development server:
pnpm run dev
Open http://localhost:3000 with your browser to see the result.
This template offers examples on how to utilize next.js patterns in conjuction with
@whop-sdk/core
/pages
The examples in this list show how to use
getServerSideProps
pages
pages/ssr/index.tsx
User
pages/ssr/logged-in.tsx
/ssr
pages/ssr/product-gated.tsx
Product
/pages
pages/ssg/product-gated.tsx
middleware
Product
middleware
/app
The examples in this list show how to use
@whop-sdk/core
app
next@13.0.0
app/app/ssr/page.tsx
page
app/app/ssr/product-gated/layout.tsx
layout
app/app/ssr/product-gated/page.tsx
page
layout
app/app/ssr/product-gated/layout.tsx
app/app/ssg/product-gated/page.tsx
page
middleware
pages/ssg/product-gated.tsx
/api
pages/api/product-gated.ts
api route
UserService
To learn more about Next.js, take a look at the following resources:
You can check out this templates' GitHub repository - your feedback and contributions are welcome!