The value to validate (typically parsed from the storefront's homepage)
Type predicate indicating whether the value carries a usable host and api_key
isValidSearchaniseApiObject({ host: 'https://searchserverapi1.com', api_key: '4p4M0R6q0N' });
// true
isValidSearchaniseApiObject({ host: 'https://searchserverapi1.com', api_key: 'short' });
// false
export function isValidSearchaniseApiObject(data: unknown): data is SearchaniseApiObject {
return v.safeParse(searchaniseApiObjectSchema, data).success;
}
Type guard for the
window.Searchaniseobject that Searchanise-powered storefronts embed in their pages. Requires a non-emptyhoststring and a 10-character alphanumericapi_key; other fields are ignored.