Skip to main content
This function and all other functions in this graphql sdk are deprecated. Please migrate to the new rest api.
This operation is only available on the server.

Required Permissions

  • developer:basic:read
  • access_pass:basic:read (optional)
  • developer:manage_api_key (optional)

Usage

import { whopSdk } from "@/lib/whop-sdk";

const result = await whopSdk.apps.getApp({
	appId: "app_XXXXXXXX" /* Required! */,

	// ID of the company, either the tag (biz_xxx) or the page route (whop-dev)
	companyId: "biz_XXXXXXXX" /* Required! */,
});

Example output

const result = {
	// The app for the company
	app: {
		// The ID of the app
		id: "xxxxxxxxxxx",

		// The name of the app
		name: "some string",

		// The description of the app
		description: "some string",

		// If the status is live, the app is visible on Whop discovery. In order to be
		// live, you need to set the name, icon, and description. Being unlisted or
		// hidden means it's not visible on Whop but you can still install the app via
		// direct link. To remove the app from whop discovery, you should set the status to unlisted.
		status: "hidden" /* Valid values: hidden | live | unlisted */,

		// The icon for the app. This icon is shown on discovery, on the product page, on
		// checkout, and as a default icon for the experiences.
		icon: {
			// The source of the attachment
			source: {
				// The URL to access the attachment
				url: "some string",
			},
		},

		// Whether the app is using the default icon. We have this b/c icon is null
		// false, but we need to tell the user if they are using the default icon so they change it.
		usingDefaultIcon: true,

		// The base url of the app
		baseUrl: "some string",

		// The developer base url of the app
		baseDevUrl: "some string",

		// The path for the hub view of the app
		experiencePath: "some string",

		// The path part for a specific view of the app. This is the template part of the
		// url after the base domain. Eg: /experiences/[experienceId]
		discoverPath: "some string",

		// The path part for a specific view of the app. This is the template part of the
		// url after the base domain. Eg: /experiences/[experienceId]
		dashboardPath: "some string",

		// A collection of stats for the app.
		stats: {
			// This is the number of users that have spent time in this app in the last 24 hours.
			dau: 10,

			// This is the number of users that have spent time in this app in the last 28 days.
			mau: 10,

			// This how much time, in seconds, users have spent in this app in the last 24 hours.
			timeSpentLast24HoursInSeconds: 10,

			// This is the number of users that have spent time in this app in the last 7 days.
			wau: 10,
		},

		// The API keys for the app
		apiKeys: {
			// A list of nodes.
			nodes: [
				{
					// The ID of this API key
					id: "xxxxxxxxxxx",

					// This is the API key used to authenticate requests
					token: "some string",

					// When this API key was created at
					createdAt: 1716931200,
				},
			],
		},

		// The agent users that are owned by this application.
		agentUsers: {
			// A list of nodes.
			nodes: [
				{
					// The internal ID of the user
					id: "xxxxxxxxxxx",

					// The name of the user
					name: "some string",

					// The Whop username for this user
					username: "some string",
				},
			],
		},

		// The access pass that is used to sell the app
		accessPass: {
			// The internal ID of the public product.
			id: "xxxxxxxxxxx",

			// The status of the product in the marketplace.
			marketplaceStatus:
				"live_marketplace" /* Valid values: live_marketplace | not_available | pending_review */,

			// A count of the active memberships on this product.
			activeMembershipsCount: 10,

			// Fetch a marketplace category in respect to the level.
			marketplaceCategory: {
				// A unique identifier for the category.
				id: "xxxxxxxxxxx",

				// The name of the category.
				name: "some string",
			},
		},
	},
};