- Properly reject the
authWithOAuth2()Promisewhen manually callingpb.cancelRequest(requestKey)(previously the manual cancellation didn't account for the waiting realtime subscription).
- Normalized
pb.files.getURL()to serialize the URL query params in the same manner as in the fetch methods (e.g. passingnullorundefinedas query param value will be skipped from the generated URL).
-
Fixed abort request error detection on React Native Android/iOS (#361; thanks @nathanstitt).
-
Updated the default
getFullList()batch size to 1000 for consistency with the Dart SDK and the v0.23+ API limits.
- Fixed abort request error detection on Safari introduced with the previous release because it seems to throw
DOMException.SyntaxErroronresponse.json()failure (#pocketbase/pocketbase#7369).
- Catch aborted request error during
response.json()failure (e.g. in case of tcp connection reset) and rethrow it as normalizedClientResponseError.isAbort=trueerror.
- Fixed outdated
OAuth2ProviderTS fields (pocketbase/site#110).
- Allow body object without constructor (#352).
- Set the
causeproperty ofClientResponseErrorto the original thrown error/data for easier debugging (#349; thanks @shish).
- Ignore
undefinedproperties when submitting an object that hasBlob/Filefields (which is under the hood converted toFormData) for consistency with howJSON.stringifyworks (see pocketbase#6731).
- Removed unnecessary checks in
serializeQueryParamsand added automated tests.
- Ignore query parameters with
undefinedvalue (#330).
- Added
pb.cronsservice to interact with the cron Web APIs.
- Added support for assigning
FormDataas body to individual batch requests (pocketbase#6145).
- Added optional
pb.realtime.onDisconnecthook function. Note that the realtime client autoreconnect on its own and this hook is useful only for the cases where you want to apply a special behavior on server error or after closing the realtime connection.
- Fixed old
pb.authStore.isAdmin/pb.authStore.isAuthRecordand marked them as deprecated in favour ofpb.authStore.isSuperuser(#323). Note that with PocketBase v0.23.0 superusers are converted to a system auth collection so you can always simply check the value ofpb.authStore.record?.collectionName.
-
Added support for sending batch/transactional create/updated/delete/upsert requests with the new batch Web APIs.
const batch = pb.createBatch(); batch.collection("example1").create({ ... }); batch.collection("example2").update("RECORD_ID", { ... }); batch.collection("example3").delete("RECORD_ID"); batch.collection("example4").upsert({ ... }); const result = await batch.send();
-
Added support for authenticating with OTP (email code):
const result = await pb.collection("users").requestOTP("test@example.com"); // ... show a modal for users to check their email and to enter the received code ... await pb.collection("users").authWithOTP(result.otpId, "EMAIL_CODE");
Note that PocketBase v0.23.0 comes also with Multi-factor authentication (MFA) support. When enabled from the dashboard, the first auth attempt will result in 401 response and a
mfaIdresponse, that will have to be submitted with the second auth request. For example:try { await pb.collection("users").authWithPassword("test@example.com", "1234567890"); } catch (err) { const mfaId = err.response?.mfaId; if (!mfaId) { throw err; // not mfa -> rethrow } // the user needs to authenticate again with another auth method, for example OTP const result = await pb.collection("users").requestOTP("test@example.com"); // ... show a modal for users to check their email and to enter the received code ... await pb.collection("users").authWithOTP(result.otpId, "EMAIL_CODE", { "mfaId": mfaId }); }
-
Added new
pb.collection("users").impersonate("RECORD_ID")method for superusers. It authenticates with the specified record id and returns a new client with the impersonated auth state loaded in a memory store.// authenticate as superusers (with v0.23.0 admins is converted to a special system auth collection "_superusers"): await pb.collection("_superusers").authWithPassword("test@example.com", "1234567890"); // impersonate const impersonateClient = pb.collection("users").impersonate("USER_RECORD_ID", 3600 /* optional token duration in seconds */) // log the impersonate token and user data console.log(impersonateClient.authStore.token); console.log(impersonateClient.authStore.record); // send requests as the impersonated user impersonateClient.collection("example").getFullList();
-
Added new
pb.collections.getScaffolds()method to retrieve a type indexed map with the collection models (base, auth, view) loaded with their defaults. -
Added new
pb.collections.truncate(idOrName)to delete all records associated with the specified collection. -
Added the submitted fetch options as 3rd last argument in the
pb.afterSendhook. -
Instead of replacing the entire
pb.authStore.record, on auth record update we now only replace the available returned response record data (pocketbase#5638). -
⚠️ Admins are converted to_superusersauth collection and there is no longerAdminServiceandAdminModeltypes.pb.adminsis soft-deprecated and aliased topb.collection("_superusers").// before -> after pb.admins.* -> pb.collection("_superusers").*
-
⚠️ pb.authStore.modelis soft-deprecated and superseded bypb.authStore.record. -
⚠️ Soft-deprecated the OAuth2 success authmeta.avatarUrlresponse field in favour ofmeta.avatarURLfor consistency with the Go conventions. -
⚠️ ChangedAuthMethodsListinerface fields to accomodate the new auth methods andlistAuthMethods()response.{ "mfa": { "duration": 100, "enabled": true }, "otp": { "duration": 0, "enabled": false }, "password": { "enabled": true, "identityFields": ["email", "username"] }, "oauth2": { "enabled": true, "providers": [{"name": "gitlab", ...}, {"name": "google", ...}] } } -
⚠️ Require specifying collection id or name when sending test email because the email templates can be changed per collection.// old pb.settings.testEmail(email, "verification") // new pb.settings.testEmail("users", email, "verification")
-
⚠️ Soft-deprecated and aliased*Url()->*URL()methods for consistency with other similar native JS APIs and the accepted Go conventions. The old methods still works but you may get a console warning to replace them because they will be removed in the future.pb.baseUrl -> pb.baseURL pb.buildUrl() -> pb.buildURL() pb.files.getUrl() -> pb.files.getURL() pb.backups.getDownloadUrl() -> pb.backups.getDownloadURL()
-
⚠️ RenamedCollectionModel.schematoCollectionModel.fields. -
⚠️ Renamed typeSchemaFieldtoCollectionField.
- Shallow copy the realtime subscribe
optionsargument for consistency with the other methods (#308).
- Fixed the
requestKeyhandling inauthWithOAuth2({...})to allow manually cancelling the entire OAuth2 pending request flow usingpb.cancelRequest(requestKey). Due to thewindow.closecaveats note that the OAuth2 popup window may still remain open depending on which stage of the OAuth2 flow the cancellation has been invoked.
- Enforce temporary the
atobpolyfill for ReactNative until Expo 51+ and React Native v0.74+atobfix get released.
- Exported
HealthServicetypes (#289).
-
Manually update the verified state of the current matching
AuthStoremodel on successful "confirm-verification" call. -
Manually clear the current matching
AuthStoreon "confirm-email-change" call because previous tokens are always invalidated. -
Updated the
fetchmock tests to check also the sent body params. -
Formatted the source and tests with prettier.
multipart/form-data body is handled.
-
Properly sent json body with
multipart/form-datarequests. This should fix the edge cases mentioned in the v0.20.3 release. -
Gracefully handle OAuth2 redirect error with the
authWithOAuth2()call.
-
Partial and temporary workaround for the auto
application/json->multipart/form-datarequest serialization of ajsonfield when aBlob/Fileis found in the request body (#274).The "fix" is partial because there are still 2 edge cases that are not handled - when a
jsonfield value is empty array (eg.[]) or array of strings (eg.["a","b"]). The reason for this is because the SDK doesn't have information about the field types and doesn't know which field is ajsonor an arrayableselect,fileorrelation, so it can't serialize it properly on its own asFormDatastring value.If you are having troubles with persisting
jsonvalues as part of amultipart/form-datarequest the easiest fix for now is to manually stringify thejsonfield value:await pb.collection("example").create({ // having a Blob/File as object value will convert the request to multipart/form-data "someFileField": new Blob([123]), "someJsonField": JSON.stringify(["a","b","c"]), })
A proper fix for this will be implemented with PocketBase v0.21.0 where we'll have support for a special
@jsonPayloadmultipart body key, which will allow us to submit mixedmultipart/form-datacontent (kindof similar to themultipart/mixedMIME).
-
Throw 404 error for
getOne("")when invoked with empty id (#271). -
Added
@throw {ClientResponseError}jsdoc annotation to the regular request methods (#262).
- Propagate the
PB_CONNECTevent to allow listening to the realtime connect/reconnect events.pb.realtime.subscribe("PB_CONNECT", (e) => { console.log(e.clientId); })
-
Added
expand,filter,fields, custom query and headers parameters support for the realtime subscriptions.pb.collection("example").subscribe("*", (e) => { ... }, { filter: "someField > 10" });
This works only with PocketBase v0.20.0+.
-
Changes to the logs service methods in relation to the logs generalization in PocketBase v0.20.0+:
pb.logs.getRequestsList(...) -> pb.logs.getList(...) pb.logs.getRequest(...) -> pb.logs.getOne(...) pb.logs.getRequestsStats(...) -> pb.logs.getStats(...)
-
Added missing
SchemaField.presentablefield. -
Added new
AuthProviderInfo.displayNamestring field. -
Added new
AuthMethodsList.onlyVerifiedbool field.
-
Added
pb.filter(rawExpr, params?)helper to construct a filter string with placeholder parameters populated from an object.const record = await pb.collection("example").getList(1, 20, { // the same as: "title ~ 'te\\'st' && (totalA = 123 || totalB = 123)" filter: pb.filter("title ~ {:title} && (totalA = {:num} || totalB = {:num})", { title: "te'st", num: 123 }) })
The supported placeholder parameter values are:
string(single quotes will be autoescaped)numberbooleanDateobject (will be stringified into the format expected by PocketBase)null- anything else is converted to a string using
JSON.stringify()
- Added optional generic support for the
RecordService(#251). This should allow specifying a single TypeScript definition for the client, eg. using type assertion:interface Task { id: string; name: string; } interface Post { id: string; title: string; active: boolean; } interface TypedPocketBase extends PocketBase { collection(idOrName: string): RecordService // default fallback for any other collection collection(idOrName: 'tasks'): RecordService<Task> collection(idOrName: 'posts'): RecordService<Post> } ... const pb = new PocketBase("http://127.0.0.1:8090") as TypedPocketBase; // the same as pb.collection('tasks').getOne<Task>("RECORD_ID") await pb.collection('tasks').getOne("RECORD_ID") // -> results in Task // the same as pb.collection('posts').getOne<Post>("RECORD_ID") await pb.collection('posts').getOne("RECORD_ID") // -> results in Post
- Added support for assigning a
PromiseasAsyncAuthStoreinitial value (#249).
- Fixed realtime subscriptions auto cancellation to use the proper
requestKeyparam.
-
Added
pb.backups.upload(data)action (available with PocketBase v0.18.0). -
Added experimental
autoRefreshThresholdoption to auto refresh (or reauthenticate) the AuthStore when authenticated as admin. This could be used as an alternative to fixed Admin API keys.await pb.admins.authWithPassword("test@example.com", "1234567890", { // This will trigger auto refresh or auto reauthentication in case // the token has expired or is going to expire in the next 30 minutes. autoRefreshThreshold: 30 * 60 })
- Loosen the type check when calling
pb.files.getUrl(user, filename)to allow passing thepb.authStore.modelwithout type assertion.
- Fixed mulitple File/Blob array values not transformed properly to their FormData equivalent when an object syntax is used.
- Fixed typo in the deprecation console.warn messages (#235; thanks @heloineto).
-
To simplify file uploads, we now allow sending the
multipart/form-datarequest body also as plain object if at least one of the object props hasFileorBlobvalue.// the standard way to create multipart/form-data body const data = new FormData(); data.set("title", "lorem ipsum...") data.set("document", new File(...)) // this is the same as above // (it will be converted behind the scenes to FormData) const data = { "title": "lorem ipsum...", "document": new File(...), }; await pb.collection("example").create(data);
-
Added new
pb.authStore.isAdminandpb.authStore.isAuthRecordhelpers to check the type of the current auth state. -
The default
LocalAuthStorenow listen to the browser storage event, so that we can sync automatically thepb.authStorestate between multiple tabs. -
Added new helper
AsyncAuthStoreclass that can be used to integrate with any 3rd party async storage implementation (usually this is needed when working with React Native):import AsyncStorage from "@react-native-async-storage/async-storage"; import PocketBase, { AsyncAuthStore } from "pocketbase"; const store = new AsyncAuthStore({ save: async (serialized) => AsyncStorage.setItem("pb_auth", serialized), initial: AsyncStorage.getItem("pb_auth"), }); const pb = new PocketBase("https://example.com", store)
-
pb.files.getUrl()now returns empty string in case an empty filename is passed. -
⚠️ All API actions now return plain object (POJO) as response, aka. the custom class wrapping was removed and you no longer need to manually callstructuredClone(response)when using with SSR frameworks.This could be a breaking change if you use the below classes (and respectively their helper methods like
$isNew,$load(), etc.) since they were replaced with plain TS interfaces:class BaseModel -> interface BaseModel class Admin -> interface AdminModel class Record -> interface RecordModel class LogRequest -> interface LogRequestModel class ExternalAuth -> interface ExternalAuthModel class Collection -> interface CollectionModel class SchemaField -> interface SchemaField class ListResult -> interface ListResult
Side-note: If you use somewhere in your code the
RecordandAdminclasses to determine the type of yourpb.authStore.model, you can safely replace it with the newpb.authStore.isAdminandpb.authStore.isAuthRecordgetters. -
⚠️ Added support for per-requestfetchoptions, including also specifying completely customfetchimplementation.In addition to the default
fetchoptions, the following configurable fields are supported:interface SendOptions extends RequestInit { // any other custom key will be merged with the query parameters // for backward compatibility and to minimize the verbosity [key: string]: any; // optional custom fetch function to use for sending the request fetch?: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response>; // custom headers to send with the requests headers?: { [key: string]: string }; // the body of the request (serialized automatically for json requests) body?: any; // query params that will be appended to the request url query?: { [key: string]: any }; // the request identifier that can be used to cancel pending requests requestKey?: string|null; // @deprecated use `requestKey:string` instead $cancelKey?: string; // @deprecated use `requestKey:null` instead $autoCancel?: boolean; }
For most users the above will not be a breaking change since there are available function overloads (when possible) to preserve the old behavior, but you can get a warning message in the console to update to the new format. For example:
// OLD (should still work but with a warning in the console) await pb.collection("example").authRefresh({}, { "expand": "someRelField", }) // NEW await pb.collection("example").authRefresh({ "expand": "someRelField", // send some additional header "headers": { "X-Custom-Header": "123", }, "cache": "no-store" // also usually used by frameworks like Next.js })
-
Eagerly open the default OAuth2 signin popup in case no custom
urlCallbackis provided as a workaround for Safari. -
Internal refactoring (updated dev dependencies, refactored the tests to use Vitest instead of Mocha, etc.).
-
Added
skipTotal=1query parameter by default for thegetFirstListItem()andgetFullList()requests. Note that this have performance boost only with PocketBase v0.17+. -
Added optional
download=1query parameter to force file urls withContent-Disposition: attachment(supported with PocketBase v0.17+).
- Automatically resolve pending realtime connect
Promises in caseunsubscribeis called beforesubscribeis being able to complete (pocketbase#2897).
-
Replaced
new URL(...)with manual url parsing as it is not fully supported in React Native (pocketbase#2484). -
Fixed nested
ClientResponseError.originalErrorwrapping and addedClientResponseErrorconstructor tests.
- Cancel any pending subscriptions submit requests on realtime disconnect (#204).
-
Added
fieldsto the optional query parameters for limiting the returned API fields (available with PocketBase v0.16.0). -
Added
pb.backupsservice 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 -storageorbackups(available with PocketBase v0.16.0).
- Removed the legacy aliased
BaseModel.isNewgetter 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.
- Added
OAuth2AuthConfig.queryprop to send optional query parameters with theauthWithOAuth2(config)call.
- Use
location.origin + location.pathnameinstead of fulllocation.hrefwhen 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.
- Use an absolute url when the SDK is initialized with a relative base path in a browser env to ensure that the generated OAuth2 redirect and file urls are absolute.
-
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-redirectas 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.filesservice:// 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+.
-
Added option to specify a generic
send()return type and definedSendOptionstype (#171; thanks @iamelevich). -
Deprecated
SchemaField.uniqueprop since its function is replaced byCollection.indexesin the upcoming PocketBase v0.14.0 release.
-
Aliased all
BaseModelhelpers 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.beforeSendandpb.afterSendsignatures to allow returning and awaiting an optionalPromise(#166; thanks @Bobby-McBobface). -
Added
Collection.indexesfield 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.
- Fixed request
multipart/form-databody check to allow the React Native Android and iOS customFormDataimplementation as validfetchbody (#2002).
- Changed the return type of
pb.beforeSendhook 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.warnmessage to replace it.
- Exported the services class definitions to allow being used as argument types (#153).
CrudService AdminService CollectionService LogService RealtimeService RecordService SettingsService
-
Aliased/soft-deprecated
ClientResponseError.datain favor ofClientResponseError.responseto avoid the stuttering when accessing the inner error responsedatakey (aka.err.data.datanow iserr.response.data). TheClientResponseError.datawill still work but it is recommend for new code to use theresponsekey. -
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.
- Updated
getFileUrl()to accept custom types as record argument.
- Added check for the collection name before auto updating the
pb.authStorestate on auth record update/delete.
-
Added more helpful message for the
ECONNREFUSED ::1localhost 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.
- Normalized nested
expanditems toRecord|Array<Record>instances.
- Added
pb.health.check()that checks the health status of the API service (available in PocketBase v0.10.0)
- Added type declarations for the action query parameters (#102; thanks @sewera).
BaseQueryParams ListQueryParams RecordQueryParams RecordListQueryParams LogStatsQueryParams FileQueryParams
- Renamed the declaration file extension from
.d.tsto.d.mtsto prevent type resolution issues (#92).
-
Allowed catching the initial realtime connect error as part of the
subscribe()Promise resolution. -
Reimplemented the default
EventSourceretry mechanism for better control and more consistent behavior across different browsers.
This release contains only documentation fixes:
-
Fixed code comment typos.
-
Added note about loadFromCookie that you may need to call authRefresh to validate the loaded cookie state server-side.
-
Updated the SSR examples to show the authRefresh call. For the examples the authRefresh call is not required but it is there to remind users that it needs to be called if you want to do permission checks in a node env (eg. SSR) and rely on the
pb.authStore.isValid.
⚠️ Please note that this release works only with the new PocketBase v0.8+ API!See the breaking changes below for what has changed since v0.7.x.
-
Added support for optional custom
Recordtypes using TypeScript generics, eg.pb.collection('example').getList<Tasks>(). -
Added new
pb.autoCancellation(bool)method to globally enable or disable auto cancellation (trueby default). -
Added new crud method
getFirstListItem(filter)to fetch a single item by a list filter. -
You can now set additional account
createDatawhen authenticating with OAuth2. -
Added
AuthMethodsList.usernamePasswordreturn field (we now support combined username/email authentication; see belowauthWithPassword).
-
Changed the contstructor from
PocketBase(url, lang?, store?)toPocketBase(url, store?, lang?)(aka. thelangoption is now last). -
For easier and more conventional parsing, all DateTime strings now have
Zas suffix, so that you can do directlynew Date('2022-01-01 01:02:03.456Z'). -
Moved
pb.records.getFileUrl()topb.getFileUrl(). -
Moved all
pb.records.*handlers underpb.collection().*:pb.records.getFullList('example'); => pb.collection('example').getFullList(); pb.records.getList('example'); => pb.collection('example').getList(); pb.records.getOne('example', 'RECORD_ID'); => pb.collection('example').getOne('RECORD_ID'); (no old equivalent) => pb.collection('example').getFirstListItem(filter); pb.records.create('example', {...}); => pb.collection('example').create({...}); pb.records.update('example', 'RECORD_ID', {...}); => pb.collection('example').update('RECORD_ID', {...}); pb.records.delete('example', 'RECORD_ID'); => pb.collection('example').delete('RECORD_ID'); -
The
pb.realtimeservice has now a more general callback form so that it can be used with custom realtime handlers. Dedicated records specific subscribtions could be found underpb.collection().*:pb.realtime.subscribe('example', callback) => pb.collection('example').subscribe("*", callback) pb.realtime.subscribe('example/RECORD_ID', callback) => pb.collection('example').subscribe('RECORD_ID', callback) pb.realtime.unsubscribe('example') => pb.collection('example').unsubscribe("*") pb.realtime.unsubscribe('example/RECORD_ID') => pb.collection('example').unsubscribe('RECORD_ID') (no old equivalent) => pb.collection('example').unsubscribe()Additionally,
subscribe()now returnUnsubscribeFuncthat could be used to unsubscribe only from a single subscription listener. -
Moved all
pb.users.*handlers underpb.collection().*:pb.users.listAuthMethods() => pb.collection('users').listAuthMethods() pb.users.authViaEmail(email, password) => pb.collection('users').authWithPassword(usernameOrEmail, password) pb.users.authViaOAuth2(provider, code, codeVerifier, redirectUrl) => pb.collection('users').authWithOAuth2(provider, code, codeVerifier, redirectUrl, createData = {}) pb.users.refresh() => pb.collection('users').authRefresh() pb.users.requestPasswordReset(email) => pb.collection('users').requestPasswordReset(email) pb.users.confirmPasswordReset(resetToken, newPassword, newPasswordConfirm) => pb.collection('users').confirmPasswordReset(resetToken, newPassword, newPasswordConfirm) pb.users.requestVerification(email) => pb.collection('users').requestVerification(email) pb.users.confirmVerification(verificationToken) => pb.collection('users').confirmVerification(verificationToken) pb.users.requestEmailChange(newEmail) => pb.collection('users').requestEmailChange(newEmail) pb.users.confirmEmailChange(emailChangeToken, password) => pb.collection('users').confirmEmailChange(emailChangeToken, password) pb.users.listExternalAuths(recordId) => pb.collection('users').listExternalAuths(recordId) pb.users.unlinkExternalAuth(recordId, provider) => pb.collection('users').unlinkExternalAuth(recordId, provider) -
Changes in
pb.adminsfor consistency with the new auth handlers inpb.collection().*:pb.admins.authViaEmail(email, password); => pb.admins.authWithPassword(email, password); pb.admins.refresh(); => pb.admins.authRefresh(); -
To prevent confusion with the auth method responses, the following methods now returns 204 with empty body (previously 200 with token and auth model):
pb.admins.confirmPasswordReset(...): Promise<bool> pb.collection("users").confirmPasswordReset(...): Promise<bool> pb.collection("users").confirmVerification(...): Promise<bool> pb.collection("users").confirmEmailChange(...): Promise<bool>
-
Removed the
Usermodel because users are now regular records (aka.Record). The old user fieldslastResetSentAt,lastVerificationSentAtandprofileare no longer available (theprofilefields are available under theRecord.*property like any other fields). -
Renamed the special
Recordprops:@collectionId => collectionId @collectionName => collectionName @expand => expand -
Since there is no longer
Usermodel,pb.authStore.modelcan now be of typeRecord,Adminornull. -
Removed
lastResetSentAtfrom theAdminmodel. -
Replaced
ExternalAuth.userIdwith 2 newrecordIdandcollectionIdprops. -
Removed the deprecated uppercase service aliases:
client.Users => client.collection(*) client.Records => client.collection(*) client.AuthStore => client.authStore client.Realtime => client.realtime client.Admins => client.admins client.Collections => client.collections client.Logs => client.logs client.Settings => client.settings