pocketbase
Advanced tools
Changelog
0.15.2
Replaced new URL(...)
with manual url parsing as it is not fully supported in React Native (pocketbase#2484).
Fixed nested ClientResponseError.originalError
wrapping and added ClientResponseError
constructor tests.
Changelog
0.15.0
Added fields
to the optional query parameters for limiting the returned API fields (available with PocketBase v0.16.0).
Added pb.backups
service for the new PocketBase backup and restore APIs (available with PocketBase v0.16.0).
Updated pb.settings.testS3(filesystem)
to allow specifying a filesystem to test - storage
or backups
(available with PocketBase v0.16.0).
Changelog
0.14.4
BaseModel.isNew
getter since it conflicts with similarly named record fields (pocketbase#2385).
This helper is mainly used in the Admin UI, but if you are also using it in your code you can replace it with the $
prefixed version, aka. BaseModel.$isNew
.Changelog
0.14.3
OAuth2AuthConfig.query
prop to send optional query parameters with the authWithOAuth2(config)
call.Changelog
0.14.2
location.origin + location.pathname
instead of full location.href
when constructing the browser absolute url to ignore any extra hash or query parameter passed to the base url.
This is a small addition to the earlier change from v0.14.1.Changelog
0.14.1
Changelog
0.14.0
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 configure https://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 calling pb.files.getUrl()
under the hood.
Works with PocketBase v0.15.0+.