Getting Started
Last updated
Last updated
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.
This package can be installed independently using npm
.
@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.
Fixed an issue where setting timeout
to 0
in runAppleScript
would not work.
Add a new `executeSQL function.
Add a new createDeeplink
function.
Fixed the bug where failureToastOptions
did not apply for useExec
and useStreamJSON
hooks.
Avoid throwing an error when useFetch
can't parse the Content-Type
header of the response.
Fix an issue where URLSearchParams
couldn't be passed as an option to useFetch
or useCachedPromise
, causing extensions to crash.
Fixed the refresh token flow to log out the user instead of throwing an error.
Fixed an issue where bodyEncoding
wasn't properly used in OAuthService.
Add a failureToastOptions
prop to useFetch
, useCachedPromise
, and usePromise
to make it possible to customize the error displayed instead of a generic "Failed to fetch latest data".
Add useLocalStorage
hook.
Add useStreamJSON
hook.
Updated useFetch
's mapResult
type to allow returning cursor
in addition to data
and hasMore
.
Extended PaginationOptions
with cursor
.
Fixed non-paginated version of useFetch
not being re-run when url
changes.
Fixed optimisticUpdate
not working when paginating beyond the first page when using useCachedPromise
or other hooks that build on top of it..
Fixed useFetch
type requiring mapResult
for non-paginated overload.
Added default OAuth URLs for Google, Jira, and Zoom
Fixed useFetch
type for non-paginated overload.
Added pagination support to usePromise
, useCachedPromise
and useFetch
.
Add string array support for OAuth scope (Thanks @tonka3000!).
Add tokenResponseParser
and tokenRefreshResponseParser
in the options of OAuthService
.
Fix built-in Slack OAuthServices.
Fixed bodyEncoding for some built-in OAuthServices.
Fixed types for OAuthService.slack
.
Fixed the refresh flow of OAuthService
that would return outdated tokens.
Removed some default OAuth clientIDs that could not work with generic scopes.
Fixed withAccessToken
when used in no-view commands.
Fixed Google OAuth configuration.
Added the OAuth utils.
Fix an issue where the values passed to the reset
function of the useForm
hook wouldn't be respected.
Add a new showFailureToast
function.
Fix an issue where useForm
's reset
function would not reset the value of some fields (which defeats its purpose...)
Add a new useFrecencySorting
hook.
Change the default options.timeout
of useExec
to 10s.
Add a new runAppleScript
function.
Change the default options.timeout
of useExec
to 10s.
Change the signature of getProgressIcon
to accept a Color
in addition to a string for the options.background
.
Change the signature of getProgressIcon
to accept a Color
in addition to a string for the color
.
Added the useAI
hook.
Added the useSQL
hook.
Added the reset
method to useForm
.
Added the focus
method to useForm
.
Added the input
option to useExec
.
Added useExec
and useForm
hooks.
Added getFavicon
method.
First release of the utilities.