Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions utils-dataprops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,30 @@

This document describes the `API` of the `utils` parameter.


## `utils.get(name: string): string`
## `utils.getCookie(name: string): string`

Function to get the value of a cookie with the provided `name`


## `utils.set(name: string, value: string): void`
## `utils.setCookie(name: string, value: string): void`

Function to create a cookie with `name` and `value`


## `utils.addAmpScript(name: string): void`

Adds AMP script with the provided `name`. See [block utils docs][utils-block]


## `utils.addScript(url: string): void`

Adds script with `url` to the head of the document. See [block utils docs][utils-block]


## `utils.canonicalUrl(query?: Object): string`

Returns a store URL with a query string. See [block utils docs][utils-block]


## `utils.isAmpRequest: boolean`

Returns `true` if the request is AMP. See [block utils docs][utils-block]


## `utils.queryParams(): Object`

Returns an object with the query parameters of the current request.
Expand All @@ -53,21 +46,17 @@ console.log(utils.queryParams());

Return an object with helpful functions for SEO as documented below.

*`utils.seo().setTitle(title: string)`*
_`utils.seo().setTitle(title: string)`_

Sets the title of the page to the provided `title`

*`utils.seo().setDescription(description: string)`*
_`utils.seo().setDescription(description: string)`_

Sets a description to be used in the meta description using the `description` parameter.


## `utils.client`

See the [Volusion API client][volusion-api] documentation.


[utils-block]: ../utils-block
[volusion-api]: ../volusion-api-client