Releases: pocketbase/js-sdk
v0.14.0 Release
-
Added simplified
authWithOAuth2()
version without having to implement custom redirect, deeplink or even page reload:const authData = await pb.collection('users').authWithOAuth2({ provider: 'google' })
Works with PocketBase v0.15.0+.
This method initializes a one-off realtime subscription and will
open a popup window with the OAuth2 vendor page to authenticate.
Once the external OAuth2 sign-in/sign-up flow is completed, the popup
window will be automatically closed and the OAuth2 data sent back
to the user through the previously established realtime connection.Site-note: when creating the OAuth2 app in the provider dashboard
you have to configurehttps://yourdomain.com/api/oauth2-redirect
as redirect URL.The "manual" code exchange flow is still supported as
authWithOAuth2Code(provider, code, codeVerifier, redirectUrl)
.For backward compatibility it is also available as soft-deprecated function overload of
authWithOAuth2(provider, code, codeVerifier, redirectUrl)
. -
Added new
pb.files
service:// Builds and returns an absolute record file url for the provided filename. π pb.files.getUrl(record, filename, queryParams = {}); // Requests a new private file access token for the current auth model (admin or record). π pb.files.getToken(queryParams = {});
pb.getFileUrl()
is soft-deprecated and acts as alias callingpb.files.getUrl()
under the hood.Works with PocketBase v0.15.0+.
v0.13.1 Release
-
Added option to specify a generic
send()
return type and definedSendOptions
type (#171; thanks @iamelevich). -
Deprecated
SchemaField.unique
prop since its function is replaced byCollection.indexes
in the upcoming PocketBase v0.14.0 release.
v0.13.0 Release
-
Aliased all
BaseModel
helpers with$
equivalent to avoid conflicts with the dynamic record props (#169).isNew -> $isNew load(data) -> $load(data) clone() -> $clone() export() -> $export() // ...
For backward compatibility, the old helpers will still continue to work if the record doesn't have a conflicting field name.
-
Updated
pb.beforeSend
andpb.afterSend
signatures to allow returning and awaiting an optionalPromise
(#166; thanks @Bobby-McBobface). -
Added
Collection.indexes
field for the new collection indexes support in the upcoming PocketBase v0.14.0. -
Added
pb.settings.generateAppleClientSecret()
for sending a request to generate Apple OAuth2 client secret in the upcoming PocketBase v0.14.0.
v0.12.1 Release
- Fixed request
multipart/form-data
body check to allow the React Native Android and iOS customFormData
implementation as validfetch
body (#2002).
v0.12.0 Release
- Changed the return type of
pb.beforeSend
hook to allow modifying the request url (#1930).The old return format is soft-deprecated and will still work, but you'll get a// old pb.beforeSend = function (url, options) { ... return options; } // new pb.beforeSend = function (url, options) { ... return { url, options }; }
console.warn
message to replace it.
v0.11.1 Release
- Exported the services class definitions to allow being used as argument types (#153).
CrudService AdminService CollectionService LogService RealtimeService RecordService SettingsService
v0.11.0 Release
-
Aliased/soft-deprecated
ClientResponseError.data
in favor ofClientResponseError.response
to avoid the stuttering when accessing the inner error responsedata
key (aka.err.data.data
now iserr.response.data
).
TheClientResponseError.data
will still work but it is recommend for new code to use theresponse
key. -
Added
getFullList(queryParams = {})
overload since the default batch size in most cases doesn't need to change (it can be defined as query parameter).
The old formgetFullList(batch = 200, queryParams = {})
will still work, but it is recommend for new code to use the shorter form.
v0.10.2 Release
- Updated
getFileUrl()
to accept custom types as record argument (#150).
v0.10.1 Release
- Added check for the collection name before auto updating the
pb.authStore
state on auth record update/delete.
v0.10.0 Release
-
Added more helpful message for the
ECONNREFUSED ::1
localhost error (related to #21). -
Preserved the "original" function and class names in the minified output for those who rely on
*.prototype.name
. -
Allowed sending the existing valid auth token with the
authWithPassword()
calls. -
Updated the Nuxt3 SSR examples to use the built-in
useCookie()
helper.