Skip to content

@vitabletech/gbp-sdk


Constructors

Constructor

new GBPClient(config): GBPClient

Parameters

config

GBPClientConfig

Returns

GBPClient

Properties

accounts

accounts: AccountsService


attributes

attributes: AttributesService


categories

categories: CategoriesService


chains

chains: ChainsService


locations

locations: LocationsService


media

media: MediaService


metrics

metrics: MetricsService


posts

posts: PostsService


reviews

reviews: ReviewsService


verifications

verifications: VerificationsService

Methods

getAuthorizationUrl()

getAuthorizationUrl(scopes, state?): string

Generates the OAuth 2.0 authorization URL for user consent.

Parameters

scopes

string[]

state?

string

Returns

string


getTokenInfo()

getTokenInfo(): Promise<any>

Retrieves information about the current access token, such as its expiration time, scopes, and app ID.

Returns

Promise<any>


processAuthCode()

processAuthCode(code): Promise<void>

Processes an OAuth 2.0 authorization code to fetch and store tokens.

Parameters

code

string

Returns

Promise<void>


request()

request<T>(options): Promise<T>

Generic request method for unsupported or custom API endpoints. This allows developers to use newly released Google APIs immediately.

Type Parameters

T

T = any

Parameters

options

RequestOptions

Request options including url, method, query, body, etc.

Returns

Promise<T>

The parsed JSON response or raw text.