Code Monkey home page Code Monkey logo

whop-apps-template's Introduction

whop-apps-template

This template includes everything you need to get started building an app on Whop. It comes pre-installed with the Apps SDK which has all the tool you need to get building. It also comes preinstalled with Frosted UI, our UI kit.

It uses Next.js with the app router. This is the recommended approach to building apps on Whop, but you can use any framework you like.

Getting started

To use this template, you will need to make sure the .env.local file is populated with the correct values, the SDK needs these to work. You can find more information about where to get all of these values here.

You can then start a local development server using the Whop Proxy:

yarn whop-proxy
# or
npm run whop-proxy
# or
pnpm whop-proxy

This is meant to be run inside Whop. To learn more about how to setup your app and test it locally, check out this guide.


Pages

In the project, you will see 4 pages have been created:

  • /seller/[companyId]

This is the seller view. It will be accessible by sellers on the Whop Dashboard under "Installed Apps". It is a great place to put any admin settings or configuration for your app.

  • /seller-product/[experienceId]

This is the seller product view. It will be accessible by sellers on the Whop Dashboard after adding the app as an experience to one of their products. This view is specific to that experience.

  • /customer/[experienceId]

This is the customer view. It will be accessible by customers on whop.com after adding purchasing a product with the app as an experience. This view is specific to that experience.

  • /before-checkout/[checkoutSessionId]

This the checkout view. It will be accessible by customers when checking out a product on whop.com that has this app added to it.

To learn more about the different views, check out this list of views.


Webhook Handler

In the /webhook route, there is a webhook handler using the Whop SDK. This is used to receive and handle any webhooks that get sent from Whop, such as when a membership goes valid, or a payment goes through.

To learn more about how the webhook functions work, head to the Webhooks Guide.


iframe.ts

You will see in the lib folder, there is a file called iframe.ts. This sets up a background listener that is required for communication over Post Message. This allows you to call the function anywhere in the project and open external URLs.


Further Reading


This is a Next.js project bootstrapped with create-next-app. Before starting your work, make sure you update to the latest version of NextJS.

whop-apps-template's People

Contributors

jedpattersonn avatar jjantschulev avatar g-delmo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.