API Reference
Complete Web SDK methods reference
Constructor
new Grovs(APIKey, linkHandlingCallback)Create a new SDK instance.
| Parameter | Type | Description |
|---|---|---|
APIKey | string | Your Grovs API key |
linkHandlingCallback | function | Callback that receives link data for matching links |
Methods
start
grovs.start()Initialize and authenticate the SDK. Must be called after creating the instance.
createLink
grovs.createLink(title, subtitle, imageURL, data, success, error)Create a new smart link.
| Parameter | Type | Description |
|---|---|---|
title | string | Link preview title |
subtitle | string | Link preview subtitle |
imageURL | string | Link preview image URL |
data | object | Custom payload data |
success | function | Success callback with link response |
error | function | Error callback |
userIdentifier
grovs.userIdentifier(): string | nullGet the current user identifier.
setUserIdentifier
grovs.setUserIdentifier(identifier)Set the user identifier for attribution.
userAttributes
grovs.userAttributes(): object | nullGet the current user attributes.
setUserAttributes
grovs.setUserAttributes(attributes)Set user attributes for identification and analytics.
| Parameter | Type | Description |
|---|---|---|
attributes | object | Key-value pairs of user attributes |
authenticated
grovs.authenticated(): booleanCheck if the SDK is currently authenticated. Returns true after a successful start() call.