Getting Started
In addition to the Raycast API which is bundled as part of the app, we also provide a sibling package that contains a set of utilities to streamline common patterns and operations used in extensions.

Installation
This package can be installed independently using npm.
npm install --save @raycast/utils@raycast/utils has a peer dependency on @raycast/api. This means that a certain version of utils will require a version above a certain version of api. npm will warn you if that is not the case.
Changelog
v2.2.1
Fix compiled file to actually make
useSQLandexecuteSQLwork on Windows.
v2.2.0
Make
useSQLandexecuteSQLwork on Windows.
v2.1.1
Fix the default size of
getFavicon.
v2.1.0
getFaviconwill now respect the user's setting for the favicon provider. Note that theAppleprovider isn't supported since it relies on a native API.
v2.0.1
Fix types for ESM extensions
v2.0.0
The library can now be tree-shaken, reducing its size considerably.
When using
usePromiseand mutating the data with an optimistic update before it is fetched, the current fetch will be aborted to avoid a race condition.Add a new
runPowerShellScriptfunction.
v1.19.1
Fixed an issue where arguments weren't passed to
withCache.
v1.19.0
Add a new
withCachefunction.
v1.18.1
Fixed an issue where setting
timeoutto0inrunAppleScriptwould not work.
v1.18.0
Add a new `executeSQL function.
v1.17.0
Add a new
createDeeplinkfunction.
v1.16.5
Fixed the bug where
failureToastOptionsdid not apply foruseExecanduseStreamJSONhooks.
v1.16.4
Avoid throwing an error when
useFetchcan't parse theContent-Typeheader of the response.
v1.16.3
Fix an issue where
URLSearchParamscouldn't be passed as an option touseFetchoruseCachedPromise, causing extensions to crash.
v1.16.2
Fixed the refresh token flow to log out the user instead of throwing an error.
v1.16.1
Fixed an issue where
bodyEncodingwasn't properly used in OAuthService.
v1.16.0
Add a
failureToastOptionsprop touseFetch,useCachedPromise, andusePromiseto make it possible to customize the error displayed instead of a generic "Failed to fetch latest data".
v1.15.0
Add
useLocalStoragehook.
v1.14.0
Add
useStreamJSONhook.
v1.13.6
Updated
useFetch'smapResulttype to allow returningcursorin addition todataandhasMore.
v1.13.5
Extended
PaginationOptionswithcursor.
v1.13.4
Fixed non-paginated version of
useFetchnot being re-run whenurlchanges.
v1.13.3
Fixed
optimisticUpdatenot working when paginating beyond the first page when usinguseCachedPromiseor other hooks that build on top of it..Fixed
useFetchtype requiringmapResultfor non-paginated overload.
v1.13.2
Added default OAuth URLs for Google, Jira, and Zoom
v1.13.1
Fixed
useFetchtype for non-paginated overload.
v1.13.0
Added pagination support to
usePromise,useCachedPromiseanduseFetch.
v1.12.5
Add string array support for OAuth scope (Thanks @tonka3000!).
v1.12.4
Add
tokenResponseParserandtokenRefreshResponseParserin the options ofOAuthService.Fix built-in Slack OAuthServices.
v1.12.3
Fixed bodyEncoding for some built-in OAuthServices.
v1.12.2
Fixed types for
OAuthService.slack.
v1.12.1
Fixed the refresh flow of
OAuthServicethat would return outdated tokens.
v1.12.0
Removed some default OAuth clientIDs that could not work with generic scopes.
Fixed
withAccessTokenwhen used in no-view commands.
v1.11.1
Fixed Google OAuth configuration.
v1.11.0
Added the OAuth utils.
v1.10.1
Fix an issue where the values passed to the
resetfunction of theuseFormhook wouldn't be respected.
v1.10.0
Add a new
showFailureToastfunction.
v1.9.1
Fix an issue where
useForm'sresetfunction would not reset the value of some fields (which defeats its purpose...)
v1.9.0
Add a new
useFrecencySortinghook.Change the default
options.timeoutofuseExecto 10s.
v1.8.0
Add a new
runAppleScriptfunction.Change the default
options.timeoutofuseExecto 10s.
v1.7.1
Change the signature of getProgressIcon to accept a Color in addition to a string for the options.background.
v1.7.0
Change the signature of getProgressIcon to accept a Color in addition to a string for the color.
v1.6.0
Added the useAI hook.
v1.4.0
Added the useSQL hook.
v1.3.1
Added the
resetmethod touseForm.
v1.3.0
Added the
focusmethod touseForm.Added the
inputoption touseExec.
v1.2.0
Added useExec and useForm hooks.
v1.1.0
Added getFavicon method.
v1.0.0
First release of the utilities.
Last updated

