Releases: pocketbase/js-sdk
v0.20.0 Release
-
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.presentable
field. -
Added new
AuthProviderInfo.displayName
string field. -
Added new
AuthMethodsList.onlyVerified
bool field.
v0.20.0-rc Prerelease
- Added experimental
expand
,filter
,fields
, custom query and headers parameters support for the realtime subscriptions.This works only with PocketBase v0.20.0-rc.pb.collection("example").subscribe("*", (e) => { ... }, { filter: "someField > 10" });
v0.19.0 Release
-
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)number
boolean
Date
object (will be stringified into the format expected by PocketBase)null
- anything else is converted to a string using
JSON.stringify()
v0.18.3 Release
- 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
v0.18.2 Release
- Added support for assigning a
Promise
asAsyncAuthStore
initial value (#249).
v0.18.1 Release
- Fixed realtime subscriptions auto cancellation to use the proper
requestKey
param.
v0.18.0 Release
-
Added
pb.backups.upload(data)
action (available with PocketBase v0.18.0). -
Added experimental
autoRefreshThreshold
option 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("[email protected]", "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 })
v0.17.3 Release
- Loosen the type check when calling
pb.files.getUrl(record, filename)
to allow passing thepb.authStore.model
without type assertion.
v0.17.2 Release
- Fixed mulitple
File
/Blob
array values not transformed properly to theirFormData
equivalent when an object syntax is used.
v0.17.1 Release
- Fixed typo in the deprecation console.warn messages (#235; thanks @heloineto).