Built-in utilities - Amazon AppSync Events
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Built-in utilities

The util variable contains general utility methods to help you work with data. Unless otherwise specified, all utilities use the UTF-8 character set.

Encoding utils

util.urlEncode(String)

Returns the input string as an application/x-www-form-urlencoded encoded string.

util.urlDecode(String)

Decodes an application/x-www-form-urlencoded encoded string back to its non-encoded form.

util.base64Encode(string) : string

Encodes the input into a base64-encoded string.

util.base64Decode(string) : string

Decodes the data from a base64-encoded string.