> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetNamespaceSuggestionByName

# Package: apps

# Namespace: AppsService

# Method link: https://dev.wix.com/docs/api-reference/app-management/apps/get-namespace-suggestion-by-name.md

## Introduction

Suggests a namespace from the supplied app name and the caller's account or company context.
No app ID is required, so this method can be used before creating an app.
With `type` set to `COMPANY`, falls back to the account slug if no company name is available.
To suggest a namespace for an existing app using its stored name and ownership context, use Get Namespace Suggestion.
The supplied name must not contain `wix` (case-insensitive).
The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive).
If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace.
Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.

---

## REST API

### Schema

```
 Method: getNamespaceSuggestionByName
 Description: Suggests a namespace from the supplied app name and the caller's account or company context. No app GUID is required, so this method can be used before creating an app. With `type` set to `COMPANY`, falls back to the account slug if no company name is available. To suggest a namespace for an existing app using its stored name and ownership context, use Get Namespace Suggestion. The supplied name must not contain `wix` (case-insensitive). The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive). If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace. Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.
 URL: https://www.wixapis.com/apps/v1/apps/suggest-namespace-by-name
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  name
 Method parameters: 
   query param name: name | type: name | description: App display name used to derive a namespace suggestion. | required: true | validation: maxLength 50
   param name: type | type: NamespaceType    
      - enum:
           ACCOUNT - Uses the account slug.
           COMPANY - Uses the company name, falling back to the account slug when unavailable.
 Return type: GetNamespaceSuggestionByNameResponse
  - name: namespace | type: string | description: Suggested namespace.  | validation: minLength 1, maxLength 150


```

### Examples

### Suggest a namespace before creating an app
Suggest a company-based namespace using an app display name. A suggestion does not reserve the namespace. The request was validated against the test account. The response is representative and contains fictional data.

```curl
curl -X GET \
'https://www.wixapis.com/apps/v1/apps/suggest-namespace-by-name?name=Bookings%20Helper&type=COMPANY' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appManagement.apps.getNamespaceSuggestionByName(name, options)
 Description: Suggests a namespace from the supplied app name and the caller's account or company context. No app GUID is required, so this method can be used before creating an app. With `type` set to `COMPANY`, falls back to the account slug if no company name is available. To suggest a namespace for an existing app using its stored name and ownership context, use Get Namespace Suggestion. The supplied name must not contain `wix` (case-insensitive). The exact names `google`, `facebook`, and `amazon` require privileged authorization (case-insensitive). If the base namespace is already used, suggests an alternative with a numeric suffix. Suggestions do not reserve a namespace. Set Namespace derives its own namespace from `appName` without automatically adding a collision suffix. Choose a different `appName` and retry if it conflicts.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  name
 Method parameters: 
   param name: name | type: string | description: App display name used to derive a namespace suggestion. | required: true | validation: maxLength 50
   param name: options | type: GetNamespaceSuggestionByNameOptions  none  
        - name: type | type: NamespaceType | description: Whether to derive the namespace from the caller's account or company. Default: `ACCOUNT`.  
             - enum:
             -     ACCOUNT: Uses the account slug.
             -     COMPANY: Uses the company name, falling back to the account slug when unavailable.
 Return type: PROMISE<GetNamespaceSuggestionByNameResponse>
  - name: namespace | type: string | description: Suggested namespace.  | validation: minLength 1, maxLength 150


```

### Examples

### Suggest a namespace before creating an app
```javascript
import { apps } from "@wix/app-management";

async function getNamespaceSuggestionByName() {
  const response = await apps.getNamespaceSuggestionByName(
    "Bookings Helper",
    { type: "COMPANY" },
  );
  return response;
}

/* Promise resolves to (representative, fictional values):
 * { "namespace": "@example-company/bookings-helper" }
 */

```

### getNamespaceSuggestionByName (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { apps } from '@wix/app-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { apps },
  // Include the auth strategy and host as relevant
});


async function getNamespaceSuggestionByName(name,options) {
  const response = await myWixClient.apps.getNamespaceSuggestionByName(name,options);
};
```

---