> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# app

***

## Overview

App module for reading an app's public settings.

Use it to read the app's visibility and determine whether the current visitor can access the app.
If the app requires login, use `redirectToLogin()` from the [auth module](auth) to send the visitor to the login page.

Learn more about [app visibility](/Setting-up-your-app/Managing-access#setting-your-app-visibility).

### Authentication modes

You can use this module with a client in any authentication mode. The client sends its token, if it has one, with the request.

## Methods

### getPublicSettings()

> **getPublicSettings**(): `Promise`\<`AppPublicSettingsResponse`>

Retrieves the app's public settings.

Rejects with a `Base44Error` that has a `status` of `403` when the visitor can't access the app.
Check `data.extra_data.reason` to find the cause:

* `auth_required`: The visitor must sign in.
* `user_not_registered`: The visitor is signed in but doesn't have access.

#### Returns

`AppPublicSettingsResponse`

The app's public settings.

<Accordion title="Properties">
  <ResponseField name="id" type="string" required>
    The app's ID.
  </ResponseField>

  <ResponseField name="public_settings" type="AppPublicSettings" required>
    The app's visibility.
    For supported values, see [`AppPublicSettings`](#apppublicsettings).
  </ResponseField>
</Accordion>

#### Example

<CodeGroup>
  ```typescript Redirect a visitor who isn't signed in theme={null}
  try {
    const { public_settings } = await base44.app.getPublicSettings();
    console.log('App visibility:', public_settings);
  } catch (error) {
    if (error.status === 403 && error.data?.extra_data?.reason === 'auth_required') {
      base44.auth.redirectToLogin('<URL to return to after login>');
    }
  }
  ```
</CodeGroup>

## Type Definitions

### AppPublicSettings

> **AppPublicSettings** = `"private_with_login"` | `"public_with_login"` | `"public_without_login"` | `"workspace_with_login"` | `string`

The app's [visibility](/Setting-up-your-app/Managing-access#setting-your-app-visibility).

You can set and manage the app's visibility in the app's dashboard or with the Base44 CLI [`visibility`](/developers/references/cli/commands/visibility) command.

The following table shows the supported values and the visibility each one represents:

| Value | Visibility |
| - | - |
| `private_with_login` | **Private**: Only [invited users](/Setting-up-your-app/Managing-access#inviting-users-to-your-app) |
| `workspace_with_login` | **Workspace**: Users in your Base44 [workspace](/documentation/account-and-billing/about-workspaces) |
| `public_with_login` | **Public (login required)**: Visitors must log in |
| `public_without_login` | **Public (no login)**: Anyone |

<Note>
  If your workspace [enforces SSO for apps](/Enterprise/Enterprise-SSO-and-app-visibility), apps set to `public_without_login` also require sign-in.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.