Skip to content

Releases: pocketbase/js-sdk

v0.20.0 Release

10 Dec 13:13
Compare
Choose a tag to compare
  • 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

24 Oct 12:37
Compare
Choose a tag to compare
v0.20.0-rc Prerelease Pre-release
Pre-release
  • Added experimental 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-rc.

v0.19.0 Release

18 Oct 13:57
Compare
Choose a tag to compare
  • 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

15 Oct 04:55
Compare
Choose a tag to compare
  • 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

07 Oct 06:18
Compare
Choose a tag to compare
  • Added support for assigning a Promise as AsyncAuthStore initial value (#249).

v0.18.1 Release

05 Oct 20:13
Compare
Choose a tag to compare
  • Fixed realtime subscriptions auto cancellation to use the proper requestKey param.

v0.18.0 Release

05 Sep 08:42
Compare
Choose a tag to compare
  • 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

29 Aug 03:59
Compare
Choose a tag to compare
  • Loosen the type check when calling pb.files.getUrl(record, filename) to allow passing the pb.authStore.model without type assertion.

v0.17.2 Release

27 Aug 19:21
Compare
Choose a tag to compare
  • Fixed mulitple File/Blob array values not transformed properly to their FormData equivalent when an object syntax is used.

v0.17.1 Release

27 Aug 08:07
Compare
Choose a tag to compare
  • Fixed typo in the deprecation console.warn messages (#235; thanks @heloineto).