Class: WhopSDK::Resources::Apps

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/apps.rb

Overview

Apps

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Apps

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Apps.

Parameters:



177
178
179
# File 'lib/whop_sdk/resources/apps.rb', line 177

def initialize(client:)
  @client = client
end

Instance Method Details

#create(company_id:, name:, base_url: nil, icon: nil, redirect_uris: nil, request_options: {}) ⇒ WhopSDK::Models::App

Some parameter documentations has been truncated, see Models::AppCreateParams for more details.

Register a new app on the Whop developer platform. Apps provide custom experiences that can be added to products.

Required permissions:

  • ‘developer:create_app`

  • ‘developer:manage_api_key`

‘biz_’

Parameters:

  • company_id (String)

    The unique identifier of the company to create the app for, starting with

  • name (String)

    The display name for the app, shown to users on the app store and product pages.

  • base_url (String, nil)

    The base production URL where the app is hosted, such as ‘myapp.example.

  • icon (WhopSDK::Models::AppCreateParams::Icon, nil)

    The icon image for the app in PNG, JPEG, or GIF format.

  • redirect_uris (Array<String>, nil)

    The whitelisted OAuth callback URLs that users are redirected to after authorizi

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



36
37
38
39
# File 'lib/whop_sdk/resources/apps.rb', line 36

def create(params)
  parsed, options = WhopSDK::AppCreateParams.dump_request(params)
  @client.request(method: :post, path: "apps", body: parsed, model: WhopSDK::App, options: options)
end

#list(after: nil, app_type: nil, before: nil, company_id: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, verified_apps_only: nil, view_type: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AppListResponse>

Some parameter documentations has been truncated, see Models::AppListParams for more details.

Returns a paginated list of apps on the Whop platform, with optional filtering by company, type, view support, and search query.

Parameters:

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • app_type (Symbol, WhopSDK::Models::AppType, nil)

    The type of end-user an app is built for

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • company_id (String, nil)

    Filter apps to only those created by this company, starting with ‘biz_’.

  • direction (Symbol, WhopSDK::Models::Direction, nil)

    The direction of the sort.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • order (Symbol, WhopSDK::Models::AppListParams::Order, nil)

    The order to fetch the apps in for discovery.

  • query (String, nil)

    A search string to filter apps by name, such as ‘chat’ or ‘analytics’.

  • verified_apps_only (Boolean, nil)

    Whether to only return apps that have been verified by Whop. Useful for populati

  • view_type (Symbol, WhopSDK::Models::AppViewType, nil)

    The different types of an app view

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/whop_sdk/resources/apps.rb', line 161

def list(params = {})
  parsed, options = WhopSDK::AppListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "apps",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::AppListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::App

Retrieves the details of an existing app.

Required permissions:

  • ‘developer:manage_api_key`

Parameters:

  • id (String)

    The unique identifier of the app to retrieve.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



56
57
58
59
60
61
62
63
# File 'lib/whop_sdk/resources/apps.rb', line 56

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["apps/%1$s", id],
    model: WhopSDK::App,
    options: params[:request_options]
  )
end

#update(id, app_store_description: nil, app_type: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, oauth_client_type: nil, openapi_path: nil, redirect_uris: nil, required_scopes: nil, skills_path: nil, status: nil, request_options: {}) ⇒ WhopSDK::Models::App

Some parameter documentations has been truncated, see Models::AppUpdateParams for more details.

Update the settings, metadata, or status of an existing app on the Whop developer platform.

Required permissions:

  • ‘developer:update_app`

  • ‘developer:manage_api_key`

Parameters:

  • id (String)

    The unique identifier of the app to update, starting with ‘app_’.

  • app_store_description (String, nil)

    The detailed description shown on the app store’s in-depth app view page.

  • app_type (Symbol, WhopSDK::Models::AppType, nil)

    The type of end-user an app is built for

  • base_url (String, nil)

    The base production URL where the app is hosted, such as ‘myapp.example.

  • dashboard_path (String, nil)

    The URL path for the company dashboard view of the app, such as ‘/dashboard’.

  • description (String, nil)

    A short description of the app shown in listings and search results.

  • discover_path (String, nil)

    The URL path for the discover view of the app, such as ‘/discover’.

  • experience_path (String, nil)

    The URL path for the member-facing hub view of the app, such as ‘/experiences/[e

  • icon (WhopSDK::Models::AppUpdateParams::Icon, nil)

    The icon image for the app, used in listings and navigation.

  • name (String, nil)

    The display name for the app, shown to users on the app store and product pages.

  • oauth_client_type (Symbol, WhopSDK::Models::AppUpdateParams::OAuthClientType, nil)

    How this app authenticates at the OAuth token endpoint.

  • openapi_path (String, nil)

    The URL path to the OpenAPI spec file of the app, such as ‘/assets/openapi.json’

  • redirect_uris (Array<String>, nil)

    The whitelisted OAuth callback URLs that users are redirected to after authorizi

  • required_scopes (Array<Symbol, WhopSDK::Models::AppUpdateParams::RequiredScope>, nil)

    The permission scopes the app will request from users when they install it.

  • skills_path (String, nil)

    The URL path to the skills directory of the app, such as ‘/assets/skills/’.

  • status (Symbol, WhopSDK::Models::AppStatuses, nil)

    The status of an experience interface

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



115
116
117
118
119
120
121
122
123
124
# File 'lib/whop_sdk/resources/apps.rb', line 115

def update(id, params = {})
  parsed, options = WhopSDK::AppUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["apps/%1$s", id],
    body: parsed,
    model: WhopSDK::App,
    options: options
  )
end