Search.../

getCategories( )

Gets the site category information.

Description

The getCategories() function returns a Promise that resolves to the site's category information.

The retrieved category information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getCategories(): GeneralInfoCategories

getCategories Parameters

This function does not take any parameters.

Returns

Fulfilled - An object containing the site category information. Rejected - Error message.

Return Type:

Promise<GeneralInfoCategories>
NAME
TYPE
DESCRIPTION
primary
string

Primary site category.

secondary
Array<string>

List of secondary site categories.

Was this helpful?

Get site category information

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixSiteBackend from 'wix-site-backend';
3
4export const getCategories = webMethod(Permissions.Anyone, () => {
5 return wixSiteBackend.generalInfo.getCategories();
6});
7
8/*
9 * {
10 * "primary": "business",
11 * "secondary": ["technology-apps"]
12 * }
13 */