Docs

API Reference

Complete Web SDK methods reference

Constructor

new Grovs(APIKey, linkHandlingCallback)

Create a new SDK instance.

ParameterTypeDescription
APIKeystringYour Grovs API key
linkHandlingCallbackfunctionCallback that receives link data for matching links

Methods

start

grovs.start()

Initialize and authenticate the SDK. Must be called after creating the instance.

grovs.createLink(title, subtitle, imageURL, data, success, error)

Create a new smart link.

ParameterTypeDescription
titlestringLink preview title
subtitlestringLink preview subtitle
imageURLstringLink preview image URL
dataobjectCustom payload data
successfunctionSuccess callback with link response
errorfunctionError callback

userIdentifier

grovs.userIdentifier(): string | null

Get the current user identifier.

setUserIdentifier

grovs.setUserIdentifier(identifier)

Set the user identifier for attribution.

userAttributes

grovs.userAttributes(): object | null

Get the current user attributes.

setUserAttributes

grovs.setUserAttributes(attributes)

Set user attributes for identification and analytics.

ParameterTypeDescription
attributesobjectKey-value pairs of user attributes

authenticated

grovs.authenticated(): boolean

Check if the SDK is currently authenticated. Returns true after a successful start() call.