Releases: pocketbase/js-sdk
Releases Β· pocketbase/js-sdk
v0.6.1 Release
Changes
- Updated the
client.authStore
declaration fromAuthStore | BaseAuthStore
to justBaseAuthStore
to normalize the access to the cookies andonChange
helper methods [#27] (thanks @ollema)
BaseAuthStore
.
From now custom auth stores should always implements/extends BaseAuthStore
(or any of its derivative classes, eg. LocalAuthStore
).
Or in other words, if you have previously used:
class CustomStore { ... }
// or
class CustomStore implements AuthStore { ... }
now it should be converted to:
import PocketBase, { BaseAuthStore } from "pocketbase";
class CustomStore extends BaseAuthStore { ... }
v0.6.0 Release
Changes
-
(minor breaking) Changed the TypeScript AuthStore model definition from
User|Admin|{}
toUser|Admin|null
-
Added 2 new helper methods to the
BaseAuthStore
for easier cookie management in case of SSR [#15]:// update the store with the parsed data from the cookie string client.authStore.loadFromCookie('pb_auth=...'); // exports the store data as cookie, with option to extend the default SameSite, Secure, HttpOnly, Path and Expires attributes // output: 'pb_auth=...' client.authStore.exportToCookie({ httpOnly: false });
-
Updated the README and added some notes and examples (SvelteKit, Nuxt, Next.js) for SSR integration [#15]
v0.5.0 Release
Changes
This release maps the additions in the PocketBase v0.5.0 logs and settings endpoints
- Replaced
ip
withuserIp
and theremoteIp
in the LogRequest DTO - Added
client.settings.testS3()
to perform a S3 storage connection test. - Added
client.settings.testEmail()
to send test user emails.
v0.4.1 Release
Changes
- Use the ES module as
main
entrypoint in package.json in order to fix the Vite error when loading non-default exports (pocketbase/pocketbase#320) - Fixed some typos in the README and doc comments
v0.4.0 Release
Changes
- Added new
client.collections.import(...)
handler. - Added
totalPages
to theListResult<M>
model.
v0.3.1 Release
Changes
- Clear
baseToken
andbaseModel
onBaseAuthStore.clear()
call
v0.3.0 Release
Changes
- Added
client.beforeSend
andclient.afterSend
hooks allowing more advanced request and response customizations (for more details check Send hooks) [#19]. - Added
onChange
listener to the AuthStore:client.authStore.onChange((token, model) => { console.log("Store changed":, token, model); })
- Since several users complained about this and for consistency with other js code, the UpperCamelCase API services access is now soft-deprecated. The old format will still continue to work as alias, but for new projects it is recommended to use the lowerCamelCase version:
client.AuthStore.* => client.authStore.*
client.Admins.* => client.admins.*
client.Users.* => client.users.*
client.Records.* => client.records.*
client.Collections.* => client.collections.*
client.Logs.* => client.logs.*
client.Settings.* => client.settings.*
client.Realtime.* => client.realtime.*
v0.2.2 Release
Changes
- Removed explicit fetch
mode
option and fallback to the defaults [#18]